Repository navigation
OfficeQA through Harbor in the OfficeQA paper's evaluation - #128
Conversation
b839ee3 to
5e8b643
Compare
|
Thanks for the PR! Before we review the code, the description needs to follow the PR checklists more closely (prepare-pr). Could you update it? General checklist (general-pr-checklist.md): Review is missing four items. Please add them:
The template's entries already cover Agent layers, Documentation and Independent review. Task-specific checklists: please answer each item in its own entry, not one line per checklist.
Checkboxes: tick an item only when all of it is done. The Benchmark item is ticked, but the real run is not linked yet. Validation:
Links: the README link points at your fork's branch, so it will break after merge. Please use the in-repo path, Minor: keep each template item's original text and add your answer after it. For example, the agent-layers item lost its link. Once the description is updated, the post-PR audit (post-pr-audit) can run on the new head. |
|
@haizhongzheng Thanks for the review. I've updated the description to follow the checklists: added the missing general items, answered each benchmark, test and sandbox item in its own entry, listed the exact commands, explained the RRSI failure (the Rerunning the smoke on this head also found an image bug, which |
|
Thanks for adding the Harbor baseline and smoke results. I have three requests before merge.
|
examples/officeqa_harbor/ runs OfficeQA as Harbor's task set (harbor-datasets' datasets/officeqa at 37db108), each question in its own Harbor environment, as the OfficeQA paper evaluates agents: the paper's agent prompt (Appendix E.5, without its web-search sentence), the final message's first <FINAL_ANSWER> scored by the paper's reward.py (databricks/officeqa at 2a2c3b0, the copy the tasks carry, checked against its git blob) at a 0.0% relative error, with 0.1%, 1% and 5% recorded. prepare.py rewrites the tasks: the instruction, the verifier, the corpus image with Codex, the agent's network limited to the model's hosts and the verifier's cut off, no answer source in the metadata and no oracle; the tasks it writes must match dataset.lock. It stages the new setup and replaces the previous one only after the lock check and the image build passed, so a failed rebuild leaves the last setup usable. The image removes the Codex home its build leaves, which made Harbor reinstall Codex in every trial. baseline/codex.yaml (Codex, GPT-5.6-Luna) and baseline/claude.yaml (Claude Code, Claude Haiku 5.5) evaluate no adapter on the 172 test questions of the 50 / 24 / 172 split, as the other Harbor benchmarks' baselines do, and tests/core/test_harbor_examples.py holds it to their conventions. The README follows examples/officeqa/'s; docs/recipes/officeqa_harbor.md holds the protocol, the isolation and the results' details.
dae4d70 to
9bea557
Compare
|
@iamziyuzhao Thanks. All three are done in
|
main added examples/officeqa_harbor/ (Infini-AI-Lab#128). CHANGELOG.md's Added list keeps both new entries, this example's first; docs/index.md and examples/README.md merged on their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change
Adds
examples/officeqa_harbor/: Harbor's 246 OfficeQA tasks (harbor-datasetsdatasets/officeqaat37db108), eachin its own Harbor environment, evaluated as the OfficeQA paper evaluates agents.
examples/officeqa/runs OfficeQA in the SkillOpt paper's setting instead, and Harbor's own copy of the tasks asks for/app/answer.txtscored at 1%; neither is the paper's evaluation.utils/prepare.pyrewrites the tasks: the paper's agent prompt (Appendix E.5), the paper's scorer (the tasks' ownreward.py,databricks/officeqaat2a2c3b0) on the final message's<FINAL_ANSWER>at a 0.0% relative error(0.1%, 1%, 5% recorded beside it), the corpus image with Codex, an agent allowlist of the model's hosts and no network
for the verifier, no answer source and no oracle. The tasks it writes must match the committed
dataset.lock.baseline/codex.yaml(Codex, GPT-5.6-Luna) andbaseline/claude.yaml(Claude Code, Claude Haiku 5.5) evaluate noadapter on the 172 test questions of a split of 50 train, 24 validation and 172 test questions
(SkillOpt's), as the other Harbor benchmarks' baselines do.
Differences from the paper (details in
docs/recipes/officeqa_harbor.md):reward.pyas of 2026-03Validation
On
9bea557(this head), Python 3.12, Linux, Docker, Harbor 0.25.0:python -m pytest --changedagainstmain: 1208 passed, 112 skipped, 1 failed. The one failure,tests/core/test_harbor_environment.py::test_rrsi_sees_a_harbor_rollouts_failure_and_a_cli_model_is_refused_for_harbor,fails with
ModuleNotFoundError: No module named 'rrsi': it imports the RRSI Evolver, which needs therrsidependency group, not installed in this environment, and the test does not skip without it. It fails the same way
on
main; this change does not touch it.python -m pytest examples/officeqa_harbor/utils/tests tests/core/test_harbor_examples.py --durations=0: 113 passedin 3.4 s (the example's 22 tests take 1.4 s together; the slowest,
test_a_failed_image_build_keeps_the_last_successful_setup, 0.44 s).bash docs/build.sh: built, no warnings.pre-commit run --all-files: all hooks passed.python examples/officeqa_harbor/utils/prepare.py: 246 tasks, matchingdataset.lock, the image built; the indexis byte-identical to the previous setup's and
utils/.staging/is gone.The offline walkthrough of
CONTRIBUTING.md, on9bea557:hermit check --config docs/_examples/first_training/run.yaml: exit 0, every item[ok](one warning:sandbox.enforceisbest_effort, as the walkthrough's config sets it).hermit train --config docs/_examples/first_training/run.yaml: exit 0,completed all epochs, 2 steps,first-training/final.hermit eval --config docs/_examples/first_training/run.yaml --adapter final: exit 0,mean_score1.0 on 2 tasks,0 errors.
Smoke,
hermit eval --config examples/officeqa_harbor/baseline/codex.yaml --adapter none data.test=../utils/splits/smoke.txt trainer.run_name=codex-smoke(config):
mean_score0.5,errors0, 129 s, onbbe376f, an earlier head of this PR (since then only howprepare.pyreplaces a setup and the docs changed; the tasks it prepares are the same). The records (
baseline/runs/codex-smoke/eval/none/, git-ignored asCONTRIBUTING.md asks), one row each:
jobs_dir)officeqa-uid0001officeqa-uid0001__2be6578fofficeqa-uid0027officeqa-uid0027__8041f360officeqa-uid0039officeqa-uid0039__001e6cd3officeqa-uid0041officeqa-uid0041__9960c287The smoke's records:
summary.jsonand each record ofresults.jsonl(without its output, the agent's final message){"adapter": "none", "commit": null, "tasks": 4, "repeats": 1, "mean_score": 0.5, "solved_once": 0.5, "cost_usd": null, "unknown_cost_tasks": 4, "errors": 0, "wall_s": 128.9}{"id": "officeqa-uid0001", "status": "ok", "error": null, "judge": {"score": 1.0, "feedback": "passed", "extra": {"status": "ok", "passed": true, "rewards": {"reward": 1.0, "reward_0.1pct": 1.0, "reward_1pct": 1.0, "reward_5pct": 1.0}}}, "tokens": 1286606, "wall_s": 105.2, "trial": "officeqa-uid0001__2be6578f"} {"id": "officeqa-uid0027", "status": "ok", "error": null, "judge": {"score": 0.0, "feedback": "reward 0\nverifier output (tail):\nFAIL: final answer '3169'", "extra": {"status": "ok", "passed": false, "rewards": {"reward": 0.0, "reward_0.1pct": 0.0, "reward_1pct": 0.0, "reward_5pct": 1.0}}}, "tokens": 208398, "wall_s": 81.8, "trial": "officeqa-uid0027__8041f360"} {"id": "officeqa-uid0039", "status": "ok", "error": null, "judge": {"score": 0.0, "feedback": "reward 0\nverifier output (tail):\nFAIL: final answer '180724'", "extra": {"status": "ok", "passed": false, "rewards": {"reward": 0.0, "reward_0.1pct": 1.0, "reward_1pct": 1.0, "reward_5pct": 1.0}}}, "tokens": 198748, "wall_s": 64.5, "trial": "officeqa-uid0039__001e6cd3"} {"id": "officeqa-uid0041", "status": "ok", "error": null, "judge": {"score": 1.0, "feedback": "passed", "extra": {"status": "ok", "passed": true, "rewards": {"reward": 1.0, "reward_0.1pct": 1.0, "reward_1pct": 1.0, "reward_5pct": 1.0}}}, "tokens": 250169, "wall_s": 65.4, "trial": "officeqa-uid0041__9960c287"}trialis the record'sjudge.extra.trial_dirunderjobs_dir.Baseline, Codex, the 172 test questions, 2026-11-25, with the agent, environment, judge and test split of
baseline/codex.yaml(all 172 the agent's result; records git-ignored as above, aggregates in the README's Results): 58.1% on all 172
test questions and 43.0% on the 93 OfficeQA Pro questions within that same run.
Not verified:
baseline/claude.yamlhas not been run (its config loads and passes the Harbor environment's checks inthe tests).
Review
Tests and documentation cover the affected behavior, where applicable. Tests:
examples/officeqa_harbor/utils/tests/test_prepare_and_verifier.pyand theofficeqa_harborentry oftests/core/test_harbor_examples.py. Documentation:examples/officeqa_harbor/README.md, itsutils/task-info/README.md,docs/recipes/officeqa_harbor.md(with its entries indocs/index.mdanddocs/recipes/index.md),examples/README.md(Harbor benchmarks),docs/framework/task.md,CHANGELOG.md.Commands, defaults, and public interfaces are consistent. No command, default or interface changes.
Agents follow the agent layers: model calls through Layer 1, where an agent
runs is its environment, a benchmark's own agent subclasses a core agent in its example folder. No new agent:
the configs use the Codex and Claude Code Base Agents, running in each task's Harbor environment
(
environment.harbor).Shared logs and examples contain no credentials or private data. No run records are committed; the prepared
tasks (which hold the answers) are git-ignored.
Documentation-only: links the issue where it was discussed with the core team. Not applicable.
Core changes. None under
hermit/.tests/core/test_harbor_examples.pyaddsofficeqa_harborto its listof Harbor benchmarks (no method), so the shared checks of every Harbor benchmark's configs run on it.
Implementation correctness and failures. Traced: the config's
environment.harborsettings to Harbor's trial(
agent_timeout_sec→override_timeout_sec3600, the allowlist hosts, the verifier'sno-network), seen in thesmoke trials'
config.json; the verifier's paths injudge.py. A scorer that fails, or a task without an expectedanswer, writes no reward, so the run records
agent_error(verifier_failed) and scores 0, not a wrong answer;an empty or missing final answer is the agent's 0.
prepare.pywrites toutils/.staging/and replaces theprevious tasks, index and lock only after the lock check and the image build passed, so a failed rebuild leaves
the last successful setup usable. The smoke found the image's
codex --versionwarning on stderr (a temp dir thebuild left in
/root/.codex), which Harbor read as the version, reinstalling Codex past the setup timeout; theDockerfile removes it, and the smoke was rerun on that image.
Real execution paths and tests. The smoke and the baseline go through
hermit evalwith real Codex sessionsin Harbor's environments, and their records are read as the README states (
mean_score,judge.extra.rewards);prepare.pyran on the real data; the offline walkthrough trains and evaluates through the standard CLI.The verifier's tests run the real
judge.pyagainst a stand-inreward.pywith the two functions ofdatabricks/officeqaat2a2c3b0, and once against the tasks' realreward.py(skipped when the tasks are notprepared).
Documentation. As in the first item.
This description. Read end to end against the code at
9bea557and the smoke's records.Task directories. Harbor's task directories, rewritten by
prepare.py. Not throughpython -m hermit.harbor.dataset prepare: OfficeQA is not in Harbor's registry at that commit, so nodataset.refnames it. Run in Harbor's environments withhermit.task.verify.Public and private halves. No
data.view. The rows (utils/tasks.jsonl) hold the instruction, the task'ssettings (image, resources, network, timeouts) and its metadata (
source_id,difficulty,category, tags),without
source_files/source_docs. The expected answer,reward.pyandjudge.pyare only in each task'stests/, uploaded after the agent stopped. The judge's feedback shows the verdict and the agent's own finalanswer (
passed, orFAIL: final answer '…'), never the expected one; the record'sjudge.extra.rewardsalsoholds the verdicts at 0.1%, 1% and 5%, so a reader learns how close a wrong answer came.
What a task asks. Each
task.toml: agentnetwork_mode = "allowlist"(chatgpt.com,auth.openai.com;the run adds its model's hosts), verifier
no-network, 1 CPU and 8 GB, which the configs do not override.Effective timeouts:
Parity, for a moved benchmark. Not applicable: a new benchmark;
examples/officeqa/is unchanged.A real run. The smoke above, through
hermit eval, with its records in the Validation section (git-ignoredas CONTRIBUTING.md asks, so given there rather than linked); no infrastructure error.
Group and selection. The example's tests are in its own
examples/officeqa_harbor/utils/tests/;--changedselects them (22 collected). No new helper or fixture directory.
Names. Each name states the behaviour, e.g.
test_a_task_without_an_expected_answer_is_a_verifier_failure,test_the_image_keeps_no_codex_home_from_its_build,test_a_failed_image_build_keeps_the_last_successful_setup.Docstrings. The file opens with what it covers (the baseline config,
prepare.py's rewrite, the verifier),its stand-in (the OfficeQA
reward.py) and "no network, no Harbor"; tests whose reason is not in the name carryit (the planted
rewardpackage, the image's Codex home).What it asserts. Records, files and return codes a caller sees:
reward.txt/reward.json/feedback.txt,the verifier's exit code, the rewritten
task.toml. Checked to fail without their fixes by reverting each fix:loading
reward.pyby name fails the planted-package test; dropping the empty-answer check fails themissing-answer test; not catching a scorer's error fails the scorer-failure test; the old Dockerfile fails the
image test; the previous
prepare.pyfails the failed-rebuild and lock-difference tests.Real entry points and stand-ins. The config through
Config.load; the verifier through itsmain()and, forthe import, a fresh
python3 -I -Sprocess astest.shruns it;prepare.pythrough itsmain(), withstand-ins for its clone of harbor-datasets (two tasks in Harbor's form) and for
docker build, while theframework's
hermit.harbor.datasetindex, check and lock run as subprocesses. The stand-inreward.pyreproduces the twofunctions of
databricks/officeqaat2a2c3b0; the real file is tested when present.Isolation.
tmp_pathonly; no network, sign-in or agent CLI; the real-scorer test skips, with its reason,when the tasks are not prepared.
Time and order. No dates, sleeps or shared state; each test builds its own files.
Cost. 22 tests, 1.4 s together (
--durations=0); the threeprepare.pytests take 1.1 s of it, starting theframework's dataset CLI as subprocesses; the verifier tests use one fixture.
Hygiene. No unused imports, no
noqa; every subprocess exits before its test ends, and thesubprocess.runstand-in is restored after each
main().Reuse the framework's sandbox. The agent runs in its task's Harbor environment, the verifier in it after the
agent (Harbor's shared mode) with no network; no process of the change runs
Local. Evidence, onbbe376f(an earlier head; the image, tasks and configs are unchanged since):
the smoke's trials above (
judge.extra.trial_dir, underbaseline/codex.yaml'sjobs_dir), whoseconfig.jsoncarries the allowlist's hosts and the timeouts; and a check run inside a task's environment, below: a prepared
task (
officeqa-uid0001, its image andtask.tomlasprepare.pywrites them) with a probe as its solution andas its test, run by Harbor's oracle agent (
harbor run -p <task> -a oracle). In the agent's phase only theallowlisted host answers; other hosts, a direct IP and plain HTTP get no data, DNS over TCP returns nothing, UDP
is refused,
/testsdoes not exist and no expected answer is on disk. In the verifier's phase nothing answers,not even the allowlisted host. Names resolve in both. (
/solutionis the probe's own: the prepared tasks havenone.) In the 172-question baseline the agent tried 40 times to fetch from other hosts; none returned web data.
Sandbox changes are core changes. No sandbox change.
Independent review (post-PR audit): an agent in a separate session audited
9bea557against the general,benchmark, test and sandbox checklists; no finding affects the results.