Repository navigation
Refactor 1/4: hermit/task and hermit/environment beside the agents (structure only) - #112
Merged
Merged
Conversation
…ment, hermit/common The first of four stacked changes toward Harbor-format tasks run by Hermit's own agents (design: "Hermit agent 与 benchmark 重构设计", 第二阶段). Structure only: no behavior changes, the requests every agent sends are byte for byte main's. - hermit/environment/: the environments move out of hermit/agent/ to the top level, since a task declares what it needs of one and a judge may run in one; hermit.agent.environment forwards for one release. - hermit/task/: task.py becomes a package. Task holds a public half (what the acting agent is handed, what a run records as its input) and a private half only the judge reads; Benchmark is a task set and its splits; verify.py wraps a judge as a verifier of a Task. Every name importable from hermit.task before still is. - hermit/common.py: RunOutput and load_callable, shared by agents and tasks so that neither imports the other. - The run (hermit/trainer/rollout.py) hands the agent task.given() and the verifier the whole task; the trainer, eval and hermit check read a Benchmark. The validation file the learner gets holds each task's public half. - tests/core/test_layers.py: tasks and agents never import each other; the environments import neither. tests/core/test_task.py covers the new types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the row's id - judge_verifier calls the judge with Task.row() (the public half and `_private`), as run_one did before tasks were typed; the agent still gets only the public half. - Records keep the row's own id (7, not "7"); run_tasks keys its results by task. - run_one/run_tasks keep the `judge` parameter name; the Verifier protocol states `takes_task`; agent-layers.md shows hermit/environment/ beside hermit/agent/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… row's id) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
iamziyuzhao
added a commit
to mmjzmy/hermit
that referenced
this pull request
Nov 24, 2026
main moved hermit/task.py into the hermit/task package and replaced the Harbor runner (agent.name: harbor, hermit/harbor/runner.py, harborside) with Hermit's own agents in each task's HarborEnvironment (Infini-AI-Lab#112-Infini-AI-Lab#126). Conflicts in hermit/task, the rollout, the Trainer and tests/selection.py are resolved to main's side: they were the RunUnavailable plumbing, which the next commits drop in favour of main's infra handling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
The first of four stacked PRs into
task-environment-refactor(design doc "Hermit agent 与 benchmark 重构设计",section 第二阶段): Harbor gives the data, the environments and the verifiers; Hermit runs every agent. This PR is
structure only and changes no behavior.
hermit/environment/moves out ofhermit/agent/to the top level: a task declares what it needs of anenvironment and a judge may run in one, so it belongs to no layer of the agents.
hermit.agent.environmentforwards for one release (
hermit._moved).hermit/task/:hermit/task.pybecomes a package.Task: a public half (what the acting agent is handed, what a run records as its input) and a private half onlythe judge reads. A row of
tasks.jsonlis all public, so nothing changes for existing task sets.Benchmark: a task set and its splits (replaces the trainer's, eval's andhermit check'sTaskData).verify.py: a judge wrapped as a verifier of aTask.hermit.taskbefore still is.hermit/common.py:RunOutputandload_callable, shared by agents and tasks so that neither imports the other.hermit/trainer/rollout.py) hands the agenttask.given()and the verifier the whole task. Thevalidation file the learner gets holds each task's public half.
tests/core/test_layers.py: tasks and agents never import each other; the environments import neither.Core changes:
hermit/environment/(moved),hermit/task/(new package fromtask.py),hermit/common.py,hermit/trainer/{rollout,trainer}.py,hermit/evaluate.py,hermit/settings_check.py, the acting agents' imports.Not in this PR (the next three): the bwrap backend and task directories with their own verifier (PR 2), the
Harbor environment backend and agents running in it (PR 3), the remaining benchmarks (PR 4).
Validation
Linux (RHEL 9, x86_64), bubblewrap, non-root, against
task-environment-refactor(=mainat127a1f81).Direct, Codex, Claude Code, Codex inthe bubblewrap sandbox) records byte-for-byte the same requests as
main.pytest --changed --base origin/mainin a venv with CI's optional groups, on the final head0d5f61f3:2063 passed, 118 skipped, 0 failed. New:
tests/core/test_task.py(7),test_training.py::test_eval_scores_a_task_set_with_numeric_ids(fails without its fix). CI: pass.docs/build.sh(warnings as errors): clean.gepa/smoke.yaml, seed skill, 4 test questions × 3, GLM 5.3 Flash, bubblewrap):0 errors, mean 0.17 (2/12), the same range as
main.Review
docs/framework/task.md,docs/developer/index.md,docs/framework/agent-layers.md,CHANGELOG.md.test_layers)./dual-review, this session and Codex gpt-6.1-sol, 3 rounds): round 1 found 5 (all fixed:a bare judge reads
_privateagain, records keep a row's own id, thejudgeparameter name, theVerifierprotocol's
takes_task, a stale docs tree); round 2 found 1, from a round-1 fix (eval with numeric ids; fixed,test added); round 3 none. Left:
test_layersdoes not see relative imports (minor); numeric-id training recordsnever match the split ids for their logs (the same on
main).🤖 Generated with Claude Code