Repository navigation
Harbor foundation: every CLI in a task's container, through the existing commands and configs - #105
Merged
Merged
Conversation
9 of 10 tasks
iamziyuzhao
force-pushed
the
harbor-foundation
branch
from
November 15, 2026 09:30
2ca476a to
a0f4fa8
Compare
iamziyuzhao
force-pushed
the
harbor-foundation
branch
2 times, most recently
from
November 15, 2026 19:02
31b1510 to
2d9401c
Compare
iamziyuzhao
added a commit
that referenced
this pull request
Nov 17, 2026
…hods Terminal-Bench 2.0, SWE-bench Verified, AlgoTune, Terminal-Bench-Science and LAB-Bench FigQA through Harbor, each a benchmark file (the registry's task set, locked), a baseline per profile (Codex with GPT-5.6-Luna on a ChatGPT login, Claude Code with Claude Haiku 5.5 on a Claude subscription) and the method whose paper's protocol fits it: the AHE Adapter on Terminal-Bench 2.0 in the AHE paper's in-sample protocol, trained on each task's rollouts #1 and #2 and tested on #3 and #4; its final adapter, frozen, on SWE-bench Verified and Terminal-Bench-Science against AHE's seed; SkillOpt in its paper's protocol on AlgoTune, a trial scored 1 - 1/speedup so that the mean gives AlgoTune's harmonic mean (a success, by which SkillOpt's analysts and slow update sort the rollouts, a solver faster than the reference), and on LAB-Bench FigQA, whose download is patched: the published tasks save the shuffle's seed where the agent reads it, which gives the answer away, and their verifier runs a script the agent can rewrite. LAB-Bench's test questions whose figure no training question has are listed for a second score from the same trials (utils/figures.py reads an eval's results). Every run is the framework's own commands on a config, as on main: a baseline is a config for `hermit eval` alone (`--adapter none`, or an adapter directory: a transfer's, or AHE's seed as the template's directory), whose training keys are placeholders (its Evolver, `eval-only`, one that `hermit train` does not find); a method is `hermit train` and then `hermit eval --adapter final` (and `--adapter root` for its seed or empty skill where no baseline tests it, an adapter of the same run's tree); a whole benchmark's test is an override of the same config (`data.test=../utils/splits/all.txt` with its own run name). An eval's number is the pass@1 that `python -m hermit.harbor.report` gives over the trials that are the agent's result: #105's runner runs an infra trial again, then records a failed run, 0 in `hermit eval`'s mean. AlgoTune's harmonic mean and LAB-Bench's second score read the rows the same way, and say when an eval did not finish. No trial is taken from an earlier run: there is no trial cache. SkillOpt's configs give its analysts no Codex trace summary (it describes SkillOpt's own harness). Every learner on a login waits for the plan's window (`plan_max_wait_s: null`); AHE's learners' clocks count the wait, as on main. examples/README.md says what a machine needs (bubblewrap for every run, a baseline's too) and lists every run with its trials, to be handed out; examples/conftest.py keeps `python -m pytest` out of a prepared task set and a run's `runs/`, and examples/.gitignore keeps the task sets' links out of git; tests/core/test_harbor_examples.py holds the protocols to the committed files (every learner's wait for the plan among them), loads every config as its command does (a baseline's refused by `hermit train`) and builds #105's runner from each config's settings, its startup checks included (this machine's sign-in and bubblewrap stood in for). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
…as Hermit's own sessions are What the Harbor runner needs of the layers every method shares, so that a trial in a task's container is one more session of the CLI's Base Agent: - The hosts deploy for a caller that serves the adapter's tools itself (`--no-serve-tools` on every host; Pi's and dsh's `prepare(serve_tools=False)` names no server, and the acting agents' workspace now passes the flag on, so a container session of Hermit's own runs gets no server row it cannot start) and take one task's context (`--context-file`). - Every CLI Base Agent reads a stream its caller read elsewhere: `outcome()` with no stream file reads the stream's text as it reads the file, the reply included; a missing or empty stream is a session not served, never a TypeError. - A Codex session whose sign-in or key the provider refused is `login_failed` (the run stops) if its turn did not complete, read from its own notices: never one it recovered from, what its log quotes of the session's tool calls, or an event's text (U+0085, U+2028 and U+2029 end no line of a stream); `unavailable` comes from its last failure. Codex's records are read with span prefixes too (`RUST_LOG=codex_core=info`). - hermit.agent.base.trajectory, the AHE Debugger, Harness²'s bench, RRSI's render and SkillOpt's Codex trace read a Harbor trial of any CLI (`agent/agent-<backend>.jsonl`, then Harbor's own output files, then its ATIF trajectory, which the Debugger takes before those files), and AHE's texts (EVOLVER.md's too) name that trial's files (the stream, hook audit and state under agent/; the record's instruction, as the Debugger's `task0i.md`; START.md's tree). Harness²'s bench takes a Claude Code trial's final message as the Base Agent reads its reply. MWM counts a learner session's turns and actions from the events the common reader reads (a line of the CLI's own that is no JSON object, or an event holding U+2028, no longer fails the step) and finds a task's record by the material's own file name. - A Harbor acting agent's model is bound and checked in the acting CLI's dialect (`agent (harbor, <cli>)`, an endpoint's too), the whole Binding spec kept, developer_role included, and its login is a contained session's (logins_of) unless `claude_bin` names this machine's Claude Code, whose version is then checked; the task set's benchmark file counts for both, as the runner merges it (relative to `normalize_config`'s `base`, else the working directory). hermit.harbor.clis is the table of those CLIs. - A client of a CLI's chat endpoint counts what a session that failed or that the provider refused used, which the endpoint reports in its error body (ChatClient's `count_error_usage`, set by `endpoint_spec`). tests/selection.py counts the recorded OpenCode and dsh streams as shared: the methods' tests read them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
…k's steps in order What a Harbor task set needs of the framework's own commands and configuration. There is no new way to run: training is `hermit train`, testing is `hermit eval --adapter ...`, each set by the run's YAML and overrides as before. - A run that is not the agent's result (`RunOutput.extra["unscored"]`: a Harbor trial of status infra) has status `infra`: never judged, its score null in steps.jsonl, left out of the Trainer's and `hermit eval`'s means and counted (`unscored`, in the summaries, the learning material and the card). `eval.infra_retries` and `eval.infra_wait_s` make `hermit eval` run such rows again, except a multi-step task's step rows, a task Harbor runs for none of Hermit's agents (`unsupported_task`) and any after a halt (a lost login, a usage limit). - `hermit eval` needs only what it reads (`data.tasks`, `data.test`, the agent, the judge): a config with no `data.train`, such as a baseline's, needs no template or Evolver; `hermit check` checks it as `eval` runs it (its probe on a test row), `hermit train` refuses it, and its run name is the config file's when `trainer.run_name` gives none. An adapter of the run's tree (`final`, `root`, a tag, a commit) needs that tree: without one, `eval` refuses it before any run. The `eval` section is checked where an eval runs. - With `eval.repeats` above 1, each repeat hands the pipeline copies of its rows that name it (`repeat`), so that a pipeline that keeps its trials by row (Harbor's trial cache) runs each repeat anew; results.jsonl names the repeat. With `trainer.epochs` above 1 each epoch's rows name the epoch (`epoch`), and the rows `run_agent` runs, and those of a task the epoch's order names twice, ask for a new run (`fresh`): such a pipeline runs each anew, an epoch on an adapter the one before left unchanged included, where it would have handed back the earlier trial. - A multi-step Harbor task's steps run in order in its stream: `data.shuffle` moves its rows as one; a split whose order is kept (the train split with `data.shuffle: false`, the test split, the validation split) that lists a step ahead of an earlier one, or without every earlier one, is refused before any run, and `hermit check` reports it; `next_tasks` may name a step only after the earlier ones; `run_agent` runs no training row that is such a step, and an id it does not run comes back as an error result (score 0), no longer an exception; Harness² fails such a step before any editor session, and records an infra execution's cause beside its null score. A run runs each step of a stream once, in one environment: a train split with such steps trains one epoch (`hermit train` refuses more, and `hermit check` reports it). `hermit check` checks the test split's order for a training config too, and its probe runs no later step. - The Harbor task set's tasks and jobs directories, and an eval config's tree, are run secrets. The Harbor agent is told what its streams are named for (`run_identity`: a training run's record directory and the id it keeps there, any other pipeline its own), whether they are kept for a resume (`keep_streams`: the Trainer's pipeline only, until the run finishes), the run its trials are kept to (`trial_scope`: the Trainer's pipeline only, that identity), whether the run deploys adapters, and the CLI and login of a model only a CLI reaches; `hermit check`'s probe takes no trial from the trial cache. - An acting agent of Harbor's own takes no adapter: `hermit train` refuses it, `hermit eval` runs it with `--adapter none` only, and `hermit check` reports it for a training config. tests/core/test_harbor_core.py covers these. What this commit hands the Harbor agent, the next commit's runner takes: three of these tests (Harbor's `dataset prepare`, and a pipeline closing its HarborAgent with its streams) pass from there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
…the adapter's tools, context and notes A Harbor trial ran only Codex well (and Claude Code through code of its own); the adapter's tools, a per-task context and an adapter's notes never reached the container, and infra trials counted as zeros. Now: - One HermitXXX class per CLI (hermit.harbor.clis: codex, claude, pi, opencode, dsh, mini-swe-agent) over one executor (harborside/hermit.py). Hermit's side renders each trial's session with the CLI's own Base Agent (hermit.harbor.launch: the home, the command, the environment; host paths made the container's) against the adapter deployed as `hermit deploy` lays it out, and harborside uploads and runs it as the task's agent user: the prompt on stdin, the stream in agent/agent-<backend>.jsonl, the deployment record always there (so an adapter's hooks run on Codex too, HERMIT_HOOK_LOGS set), a session still running at Harbor's timeout killed with its process group. The steps after the session still run past that timeout, and keep the session's own error when the timeout lands in them; a copy that failed is dropped, never kept in part. A `<cli>_bin` serves only at the asked-for version and when the agent user may execute it. The runner reads the stream back with the same Base Agent: reply, served, the plan's or the provider's refusal, the usage at `agent.params.price`, else at the backend's price. - The adapter's tools are served from this machine on the Docker bridge's gateway (hermit.harbor.tools, every call logged); a per-task context is computed in the adapter sandbox (hermit.harbor.context); an adapter's notes come back after the session (memory/ in the log). - A key or a token reaches the container by its variable's name only (`docker compose exec -e NAME`; Claude Code's subscription token on a descriptor), never in a command line, a file, the plan or a log; Codex's ChatGPT sign-in is a file of its home there (mode 600). Codex and Claude Code run on the user's subscription (`login: chatgpt | claude`) in the plan's slots and holds, each trial noting the plan's usage (so `MAX_USED` holds trials back): a refused session again after the window, one the provider could not serve after a pause unless it ran out of the agent's time, a lost sign-in never, none once another trial halted the run; the trial's usage is every run's. Codex's refreshed sign-in comes back and becomes the shared copy. A task whose agent network is not public gets the model's and tools' hosts allowlisted and web search off; `web_search` must be set. - The answer-only agent (`cli: answer`) makes one model call through an endpoint the runner serves and writes the answer into the container (LAB-Bench's questions); a request still in flight when the trial ends is given up, its cost unknown, and on a model a CLI reaches on a login the trial waits for that plan first (a request the plan held past the agent's time is infra, `usage_limit`). A question or attachments it cannot read fail the launch. - The judge scores the verifier's reward whenever the verifier gave one, a timeout or an agent error included (Harbor's own mean), says "passed" at `pass_reward` (null for a score scale) and leaves out what `verifier_redact` matches. Not the agent's result, so unscored (infra): a verifier whose tools never downloaded or that hit a full disk, harborside's launch failing (HermitLaunchError, the CLI's install included), a session that never started or whose tools never came up, a lost sign-in, a Claude Code, Pi or OpenCode session or an answer request the provider refused for the run's configuration before serving any (its key, model, bill or a setting it does not take: `model_rejected`, no halt), a task Harbor runs for none of Hermit's agents (MCP servers, a skills folder, a Windows container: `unsupported_task`, never handed to Harbor; the set's other tasks run). A trial out of the agent's time is the agent's even after a provider notice, and so is a request refused for its input; the adapter's context over the CLI's limit beside the image's own is the adapter's 0, and so is a session the model's safeguards ended. With `verifier_timeout: agent` (a verifier that times the agent's solution, as AlgoTune's does) a verifier out of its time is the agent's result, and Continual Harness's Refiner reads it as that, not as a session past its clock. - Startup refuses what every trial would: a login for another CLI, a login and a binding at once, a loopback model, a missing key or sign-in, a non-Docker environment for secrets by name, a plan the Base Agent cannot render (mini-swe-agent's: web search, a model class Hermit does not read), a `harbor` that is no executable file, mini-swe-agent without its package for a run that deploys adapters, the answer agent's attachments on a model a CLI reaches. Harbor's own claude-code gets a bound model's Messages API root (it was sent to /v1/v1/messages), keeps Harbor's per-task web rule unless `web_search` is false, and is refused the subscription (`CLAUDE_FORCE_OAUTH`, or the subscription's token as its only sign-in). - `python -m hermit.harbor.dataset prepare` makes an example's data from its benchmark file's `dataset:` block (the registry's tasks, rows, splits, smoke rows, a patch, the images' sizes with `image_sizes: true`, a lock). A download is moved into place only once whole, and what is in its way is refused first; a relative `data:` is the benchmark file's folder's. The lock and the download record the tasks' source (a download of another source is never reused, and the default data directory is the source's own); the lock holds no path of this machine and hashes only a mode's executable bit (one written under a umask other than 022 needs writing again); an unreadable lock is refused unless `--force`. - Also, from the Terminal-Bench 2.1 runs: a host failure (Docker's, the host's /tmp full) is infra and no trial starts while /tmp is short; the trial of a task whose name is longer than 32 characters is found; a `harbor run` past its wait budget is killed and its trial's compose projects, the verifier's too, taken down by name alone (no compose file or `COMPOSE_*` variable read). A stream's step runs its own plan, its verifier read as a trial's; each `hermit eval` repeat and each run gets streams of its own, stopped when the run ends unless a `hermit train` may resume them. The trial cache keys the launch, the whole row, the task's files, the model's price and the adapter as deployed (a file's executable bit, not the bits a umask sets; not the adapter's card, which no deployment copies, so a final adapter tested again meets its trials); a cached trial costs nothing again; a training run's trials are its own (only the run, resumed, meets them) and each epoch's too, a row asking for a new run (run_agent's, a task a split names twice) is neither taken nor kept, and `hermit check`'s probe neither takes one nor keeps one. The benchmark file's price applies to its own model, and a model the config gives as an endpoint mapping keeps its own price. - OfficeQA's Harbor judge reads the final message from HermitCodex's stream (`agent-codex.jsonl`): a task set built before needs building again. - Docs and CHANGELOG for the whole change (the framework's task, configuration and command pages; the methods' pages; the Breaking entries: the runner's `codex_login` is gone, `login: chatgpt`; a table CLI's trial needs `web_search`; secrets by name run on local Docker only). Checked in real containers on this machine, each run a `hermit eval` of a config for it alone: Codex on the ChatGPT login (no adapter; tasks with an open and a closed network; the adapter's MCP tool, AHE's hooks, Continual Harness's notes, ASPIRE's template) and Claude Code on a subscription token (an instruction that begins with `/`, the MCP tool, AHE's hooks); Pi, OpenCode, dsh and mini-swe-agent on a scripted model; the answer agent; a three-step stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthr 8BD0 opic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The post-PR audit of this PR's 2d9401c found one high issue and six medium ones, and the audit of #106's 3aa0cc2 one medium issue in this PR's code; each is fixed here, and so are five of the low ones. - Claude Code on Anthropic's own API with a key (`acting_agent: {cli: claude}`, `anthropic/<model>`, no login) started every session without a token: the launch script exported the plan's empty ANTHROPIC_API_KEY before ANTHROPIC_AUTH_TOKEN read the key from it. A variable the plan passes under another name is now set first, in one export that reads every source as Harbor passed it; a source no entry sets is unset, and the plan's own variables come after. - A Harbor halt (a lost sign-in, an API account's usage limit) ends `hermit train` unfinished at the step that met it, before its learner (after the learner's call when a run of `run_agent`'s met it), and a resume runs that step again: before, every later rollout came back infra/halted while the learner went on, and the run ended as finished. - Whether the provider could not serve a Codex session is read from its last failure since the session last worked, never from a warning of Codex's (the trust it gives a deployment's hooks), and a turn that failed, or a stream that ended, while Codex retried its requests is one it could not serve, unless the sign-in was lost: Codex 0.164 that cannot reach chatgpt.com fails its turn with `workspace routing discovery failed`, which the last-failure rule had made the agent's empty answer. Codex 0.164's own words for a lost sign-in are matched. - A ChatGPT sign-in a session hands back replaces the shared copy only as a later, well-formed refresh: a regular file of at most 64 KiB (a container's larger one is never downloaded) holding its refresh and access tokens, for the copy's account, stamped after the copy and at most a minute ahead of this machine's clock (an hour where the clock may differ). Harbor no longer gets CODEX_FORCE_AUTH_JSON or CODEX_AUTH_JSON_PATH from the user's environment. - Only a pipeline that keeps its trials by row (a Harbor task set with `trial_cache` on, in the config or its benchmark file: isolate.keeps_trials) is handed rows naming their epoch or asking for a new run; no record keeps `epoch` or `fresh` (rollout.TRIAL_KEYS), so the learning material's `input` and every learner's text of a task are the same in each epoch, and the adapter's per-task context gets the task's own row. - A Harbor trial is scored as Harbor grades it: a verifier that left no reward Harbor could read or ran out of its time (`verifier_timeout: agent`, now the default; `infra` the opt-in for a host whose load makes verifiers time out), and a request of one of Harbor's own agents that the provider refused for what it held, are the agent's result, 0 without a reward, unless the verifier's output shows its tools never arrived or the host's disk full; a provider that could not serve, or refused the run's configuration, stays infra (Hermit runs it again, where Harbor grades it). An OSError on this machine while the adapter is staged is infra (`staging_failed`); the adapter's own deployment or per-task context failing stays the agent's 0, since what its child process prints could be the adapter's words. A verdict that quotes the verifier's output applies `verifier_redact`. - `dataset prepare`: a patched set is its patch's own. The download record names the patch (its hook and its file's digest), a reuse of another source's or another patch's tasks is refused before the patch runs, the default data directory is named by the patch too (an unpatched set's name as before), and a download is patched in its own folder before it is moved into place. - The AHE Adapter's learners' clocks (`evolve_timeout_s`, the Agent Debugger's `timeout_s`) are the Base Agent's own, counted from the CLI's start: a wait for the login's plan or a session slot pauses them instead of spending them (a hold longer than a clock made the step a no-op recorded as done, or the Debugger's analyses upstream's fallback text). This reverses PR #65's choice that the Debugger's clock cover the plan wait: upstream's clocks had no plan hold to cover. `trainer.call_timeout_min` still bounds a step, waits included. - `hermit train`'s refusal of more than one epoch over a multi-step task's steps gives its true reason. Tests: test_harbor_harborside.py (every CLI's launch script on every backend run by bash, the returned files' limits), test_harbor_runner.py (grading as Harbor does, staging, redaction, the sign-in back by the environment's clock, Harbor's environment, a Codex outage), test_harbor_core.py (the rows only a trial cache is handed, the records, a halt), test_harbor_dataset.py (patched sets), test_cli_agent.py and test_base_agents.py (Codex's outcome and lost sign-in words, the take-back), tests/methods/ahe (both clocks through a real login path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The post-PR audit of this PR's fe8c5b4 found two medium issues and eleven low ones; each is fixed here. - A step of a multi-step task whose turn cannot come ends infra (stream_order) at once and starts no driver: its stream's driver waits for a step no rollout of the runner is running (one that ended before it reached the driver, or ran in an earlier training step), or the stream has no driver and no rollout of its first step is running to start one. Every later step of the stream ends the same way, and the last of them stops the driver. Before, each waited out its turn (by default its budget for each earlier step and an hour more), holding a rollout's worker, then ended infra, so a step that failed on this machine before it reached the driver, a halt (whose resume reran a later step on a new driver at step 1) or a driver gone lost the rest of the stream after hours. The runner keeps each stream's steps in flight; StreamClient.wait_turn takes what it asks. - `trial_cache` with an answer agent on a model a CLI reaches (`model: {cli, model, login}`): the trial's key held the URL of the endpoint the run's pipeline serves the model on (its port and token, and the binding's `messages_url` derived from it), which no resumed run or other eval has again, so no trial was ever taken from the cache. The key names that model by its CLI and login. - A new stream driver in a directory that held one sets the earlier one's trial and replies aside (`earlier/<n>/`): Harbor reuses a trial's step directories, so a step of a stream run again that left no output of its own was read, and billed, as the earlier run's. - A stream driver that answers no stop within 15 minutes (hung in a step) is killed with its process group, and its trial's compose projects are taken down by name. - An OSError on this machine while a trial's job and launch are written (its job directory, the launch plan, the agent's config, job.yaml), or a stream step's launch plan, is infra (`staging_failed`), as one while the adapter is staged is: before, it raised out of the rollout, the agent's 0. - A rollout that never reached a container (a halted run's, the disk gate's, an unsupported task's, a staging that failed, a stream step its driver was never asked for) costs 0: before, its cost was unknown, which left the eval's total cost unknown. A stream step lost after its request was sent keeps an unknown cost. - The ChatGPT sign-in's take-back reads the shared copy's own stamp as any accepted copy may hold it (at most an hour ahead of this machine's clock, as one from the user's own file), never as no stamp: an earlier file a session handed back replaced a copy stamped ahead of this clock. - Codex's fall back from WebSockets to HTTPS retries nothing, so a request refused after it is the session's own failure; only its reconnects (`Reconnecting...`) are retries. - `hermit eval` of a split that names a task twice keeps a row for each, as on main (the infra reruns kept the records by id). - `<jobs_dir>/HALT` names the record's cause first (`login_failed`, `usage_limit`) and says that it halts every run on that jobs directory, as the docs now do. - The docs: a sign-in file is checked for its size before it is downloaded (one grown after the check is refused when taken back); with Harbor's retry on, a failed attempt's usage is not counted; what `staging_failed` covers. The CHANGELOG's Harbor entry is rewrapped where earlier edits had cut its lines short. Tests: test_harbor_runner.py (a stream's lost turns, at once and in order, a halt's resume, a rerun's outputs, a hung driver, a stream step's launch, a lost step's cost, the CLI model's trial key, a trial's staging, a never-ran rollout's cost, the halt file), test_harbor_core.py (a split that names a task 10000 twice), test_cli_agent.py (a copy stamped ahead of this clock), test_base_agents.py (Codex's fall back). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The post-PR audit of this PR's 3a49adc found three medium issues and fifteen low ones; each is fixed here or, where it is a limit of the design, recorded in the PR. - `trial_cache` with a model a CLI reaches: 3a49adc named that model by its CLI and login alone, so a second eval on the same jobs directory whose CLI had another effort, `bin` or version met the first one's trials. The key also holds the CLI's identity (`hermit.agent.base.endpoint.cli_identity`: its settings as its sessions get them, less where they run and log and which plan they wait for, and its binary's path, size and time of change), as a digest that hermit.isolate.agent_pipeline hands the runner (`model_cli_identity`). Harbor's `retry`, the adapter sandbox's `sandbox_enforce` and `tools_host` are in the key too. - A trial whose agent ran out of its time or exited with an error is verified by Harbor and graded: when its verifier's tools then never arrived (a 5xx of GitHub's release download) or met the host's full disk, it is infra and run again, as one whose agent finished is. Before, it was the agent's 0 and stayed in the trial cache. - Codex's words for a refresh of the ChatGPT sign-in the provider refused ("Your access token could not be refreshed [because your refresh token was already used / has expired / was revoked]. Please log out and sign in again.") are a lost sign-in: the run halts. Before, the trial kept Harbor's verdict, scored 0 and cached. A sign-in refusal counts only since the session last worked: one on a side request the session worked after is none. - `run_tasks` submits each multi-step task's steps in step order, in the places its steps had: a `run_agent` call that listed a later step first, with fewer workers than the gap, gave the stream up and lost the earlier step too. - A step whose stream aborted before its turn is never asked for (`wait_turn` checks the abort first), so it costs 0; and a trial whose environment or agent setup failed before its agent started (Harbor records no `agent_execution`) costs 0. Both had an unknown cost, which left the eval's total cost unknown. - An OSError on this machine past the guarded steps (no process left to start `harbor`, a file it cannot write or read) is infra (`host_failed`), its cost unknown, not the agent's error scored 0. A trial cache this machine cannot write leaves the trial as it ended (it stands, uncached), an entry it cannot read is no trial kept, a key whose dry render cannot be written runs the trial without the cache, a sign-in take-back that fails leaves the trial as it ended, and a HALT file it cannot write leaves the halt to the rollout's output. - A stream step run again sets the tool-call log an earlier run of it left aside (`earlier-<n>-tool-calls.jsonl`) at its turn, so its curated log holds its own calls only. - A killed stream driver's socket is removed. - Only a Harbor task set's rows name their repeat (`repeat`, with `eval.repeats` above 1), and no record's `input` keeps it; a record's `input` drops only the keys its caller added (the Trainer's `epoch` and `fresh`), so a row's own field of those names stays. Every other pipeline gets its rows and records as on main, and a Harbor adapter's per-task context never reads `repeat`. - A failed `hermit eval` removes the earlier eval's `summary.json`, as it empties `results.jsonl`. - The overlap error of a declared path names a Harbor task set's directories as such. - The docs: `solved_once` counts each test id once; the steps of `run_agent`'s call run in step order; the cost of a trial that never started an agent; `host_failed`; the Codex refresh refusal and what to do about it; a copy stamped ahead by another clock is replaced once this clock passes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The post-PR audit of this PR's e7ace26 found no high or medium issue and eleven groups of low ones; the audit of the benchmarks PR stacked on it (b709e0c) found a medium issue here and a low one. Each is fixed here or, where it is a limit of the design, recorded in the PR. - `python -m pytest` imported the files of a run's folder beside an example's configs (`examples/*/runs`, their output_dir), a task container's and a learner's files among them, and ran them on this machine outside any sandbox: the root conftest ignores them, as it ignores a Harbor task set's. - A pipeline that deploys adapters is refused at startup where bubblewrap is not installed and the adapter sandbox that renders each adapter is required (`agent.params.sandbox_enforce`): each trial ended in the sandbox's error, scored 0. - A rollout that met a halt (a lost sign-in, an account's limit) and then an OSError of this machine (its curated log not written: a full disk) came back `host_failed` with no halt, so that nothing halted where its HALT file could not be written either: it keeps the halting verdict. A jobs directory this machine cannot make is `host_failed` at a cost of 0, not an error scored 0. - A stream step whose turn never came curated the tool-call log an earlier run of it left as its own: it curates none. - A verifier's words of a full disk (ENOSPC) made a trial infra even after its tests ran: now only before its tests wrote a report (`ctrf.json`), so that a test's own output (an agent's program, a task about a full disk) stays the agent's result. - The copy-back and the collect ran as root in /logs/agent, which every user can write in, through a link the agent's user could put there, and made what it named readable to all: each makes a new folder of root's, enters it, checks that it is that folder, and works in it by relative names. - `acting_agent.env` is written into each trial's job and onto `docker compose exec`'s command line: a variable of a secret's name, or a value naming one, is refused at startup. - The `tasks` link is followed once (`tasks_dir`), so that a prepare pointing it elsewhere mid-run changes neither a trial's task set nor the key it is kept under; a task's link to a folder is in its digest by where it points. - A codex, claude or pi trial of a model a CLI reaches got the loopback refusal once the pipeline served that model: it is refused for what it is. - A row of its own `epoch`, `fresh` or `repeat` field is refused where the framework adds those keys (hermit train with the trial cache, hermit eval's repeats of a Harbor task set; hermit check says so too): they would replace it, and no record would keep it. - `dataset prepare`: a data directory that is the set's own folder in another download is that download's (its marker is beside it), refused to a benchmark of another patch; a download is marked in its own folder before the set is moved into place; an image whose size cannot be read anew keeps the earlier one; split counts are whole numbers, and a smoke task is named once; the rows, the lock, the splits and the sizes are all made before any is written, so that a refusal leaves the link and every file as they were; a `data` naming a variable that is not set is refused; this machine's errors (an OSError, Harbor's failed download) are the command's `error:`, exit 1. - An ATIF trajectory's tool-call id that is no string (a list, an object) reads as no id, never a TypeError in each learner reading the log. - Tests: a trial-cache key this machine cannot make, a sign-in take-back that fails, MWM's name of a task's record. - The docs: a command a CLI ran in a session of its own (Claude Code's shell tool) is outside the process group the kill reaches; a `timeout` or an `agent_error` scores 0 when its verifier left no reward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The post-PR audit of this PR's b9a3d61 found no high or medium issue and four groups of low ones. Each is fixed here; its questions are recorded in the PR. - A `hermit eval` refused at its start (a row of its own reserved key, or a pipeline whose startup checks refuse it: no bubblewrap, a secret in its env) had already emptied the earlier eval's results.jsonl and removed its summary.json: the eval empties them once its pipeline and judge are built, as on `main`, and a refused start leaves them as they were. One that fails after its start still leaves no earlier summary. - `acting_agent.env`'s secrets are read as Harbor fills its values: `${NAME:-default}`, which Harbor fills in from this process's environment, is refused like `${NAME}` (it got through), and a referenced name is a secret's by the rule the variable's own name is (`launch.SECRET_VAR`), so that a setting named like one (`${TOKENIZERS_PARALLELISM}`) is no longer refused. `$NAME`, which Harbor hands on as that text, is still refused where it names a secret, as it never passes the secret the config meant. - `hermit check` refuses a test row's own `repeat` wherever `hermit eval` of the config would (a training config's eval too), by eval's own rule (`_harbor_rows`), and a test now covers it. - Tests: an unused fixture, a temporary directory outside the test's own `tmp_path`, blank lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
Everything in hermit/ outside hermit/harbor/ is back at main (e813538): the three agent layers, the Trainer, hermit eval, hermit check, the configuration, the sandbox, the methods and the hosts, but one change. Pi's and dsh's prepare take serve_tools, as the other four hosts already do, so that a trial gets the adapter's tools from the runner. hermit/harbor/FRAMEWORK_SUPPORT.md lists where each of Harbor's needs now lives, and what could later become framework support. What a Harbor task set now meets: - A trial that is not the agent's result (infra) runs again in the runner (agent.params.infra_retries, 2; infra_wait_s, 300 s). One still infra is refused by the judge, so the run records a failed run (judge_error): hermit eval counts it among its errors and as 0 in its mean. python -m hermit.harbor.report gives pass@1 over the trials that are the agent's result. - A lost sign-in, or an API account's usage limit, raises LoginFailed, which ends hermit train and hermit eval as a local session's does. There is no HALT file. - There is no trial cache; agent.params.trial_cache is refused. - A multi-step task's stream is the runner process's own and is never resumed; a split keeps its steps in order (data.shuffle: false). - A Codex trial's lost sign-in and provider outage are read in hermit/harbor/signin.py (the outage by the session's last failure, so a reconnect Codex recovered from is no outage). - The answer agent's model that only a CLI reaches is given in the benchmark file; a run config's own is refused at startup. - A trial's log keeps the CLI's stream, task.md, prompt.txt, last_message.txt and the hook files at its top, where the methods read a local session's. Fixes of the last audit (of 418a00d): a stream's step gets the sign-in at its turn, not when its rollout began; acting_agent.env secrets are named by Harbor's own rule; each step's allowed hosts reach the driver; the answer agent waits for its plan's window; a long task name's verifier containers are found as Harbor names them; a dataset's digest takes a link as the link itself, not the file it points to. Tests of the reverted code are back at main; the Harbor tests cover the new code. Docs and the changelog describe the PR as it is now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The first audit of the rework (2b2a46b) found no high issue, three medium and six low; a second audit of those fixes found no high issue, five medium and ten low. Each is fixed here, in hermit/harbor/, its docs and its tests, or recorded as a candidate where the fix is main's. - An adapter whose own deployment or per-task context fails in its child process is the agent's result: agent_error (adapter_failed), scored 0 with its message as the feedback, which `python -m hermit.harbor.report` counts among the scored trials. It left the pipeline as an exception before (status error), outside pass@1. - A stream's step that ends in any way before its driver is asked for it (its staging, its adapter, its tools, its launch plan, the disk gate, its turn's wait running out, its turn's sign-in or tools not readied, an exception of any of them) gives the stream up, so its driver is stopped once the stream's rollouts end, that step's own when it is the last, and the stream's next pass (an eval's next repeat, a later epoch) starts from its first step in a new environment. Before, the driver stayed up for a step that never came: the next pass's first steps ended stream_order and its last ran on the environment the pass before had left. A step the driver already ran gives nothing up. A later step of a stream with no driver and no rollout of its first step ends before anything is staged or served for it. - A runner's unfinished streams are closed by its finalizer, when the runner is freed and at exit for one still held then. Before, a weak set of runners was closed at exit, and a runner freed before then (`hermit check`'s probe, `hermit eval` once it returned) left its drivers up for stream.idle_s. - The docs say what a resumed `hermit train` does to a stream under way (its remaining steps in that epoch end stream_order, and the stream starts over at its first step's next rollout), and what an Evolver's run_agent of a stream's first step does once the Trainer's pass of it finished: it starts a pass the next epoch inherits. - A request the provider refused for the run's configuration (model_rejected) is not run again (NO_RETRY), and NO_RETRY is tested with runs again allowed; nor is a host failure past the trial's staging (host_failed, whose session may have run), which the docs now say. The `halted` cause, which nothing gives any more, is gone. - Codex: a session the provider refused for the run's configuration or bill (a 400, 402 or 404 Codex does not retry, an API account's quota) is model_rejected, as the other CLIs' are, never the agent's 0. Its usage limit is read from Codex's own notices, never from what its log quotes of the session's work, and a JSON line its log quotes no longer ends the record. A session that failed on its own after a reconnect Codex went on from, or whose response the provider's content filter ended, is no outage. - The answer agent's model a CLI reaches: its sessions run with plan_rerun off, so that a session the plan refused comes back at once (infra, run again once the plan allows) instead of waiting for the window inside the agent's time and scoring as the agent's timeout; its sign-in is checked at startup; its CLI sessions get main's check that the user's own secrets are absent (HOME_SECRETS). The runner refuses a run config's own `{cli}` model for the answer agent as written, as `hermit check` hands it, as well as the endpoint spec `hermit eval` and `hermit train` hand it, whose test builds it with main's endpoint_spec. - The docs say that `hermit check` builds the runner and reports its startup refusals, and that every run of Hermit's agents needs bubblewrap, a baseline's too (the runner cannot tell a run that deploys no adapter), unless sandbox_enforce or HA_ADAPTER_SANDBOX_ENFORCE says best_e 10BC8 ffort. - The report says when an eval did not finish: no summary.json beside its rows, one that is not of them (its count of trials, of failed runs or its mean score differ), or a last row cut off, which is left out. It reads the summary, never the files' times, which a copy changes. The docs say that a stopped eval writes no row of the repeat it stopped in. - A plan refusal's hold gets the run's stop, so that a hold that cannot be written waits no longer than the run. The docs record that trials racing on one ChatGPT copy for its refresh end the run: the loser's refusal reads as a lost sign-in. - FRAMEWORK_SUPPORT.md names the four private helpers of main that hermit/harbor/ uses, and more candidates: a trial's usage when LoginFailed ends the run, the run's own secrets for the answer agent's sandbox, public names for those helpers, rows that say who runs them (run_agent's or the Trainer's), the `login: claude` check of `hermit train`, RRSI's halt file. The docs no longer say a trial a lost sign-in ended keeps its runs' usage, and bind_agent_params is named right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
The audit of e19d155 found no high issue, two medium and twelve low, and asked eleven questions. Each is fixed here, in hermit/harbor/, its docs and its tests, or recorded as a candidate where the fix is main's. - Pi's and dsh's trials get the backend's developer_role, as Hermit's own sessions do: the spec the config's loading keeps drops it (Binding.spec), so the runner takes the backends registry's for a backend it names at the same URL. A test compares a trial's provider settings with main's bind_agent_params on Fireworks (developer_role: system). - `hermit check` and `hermit train` check a Harbor run's acting model as a chat client's, main's rule for an agent it does not know: they refuse Claude Code on Anthropic's API, which `hermit eval` runs, and do not check that Codex's backend serves the Responses API. The docs say so, and candidate 7 names the cause in main. - On a login, busy_retries is one count over all of a trial's runs: infra_retries no longer multiplies it (up to 12 runs by default, where the docs said 4). A plan refusal of the answer agent's model runs the trial again once the plan allows, not counted in infra_retries. - A staging or per-task-context child that failed is the host's failure (staging_failed, run again), not the adapter's 0, when this process sees this machine fail any adapter's staging there: a folder it cannot write, less than 64 MB free, the strict adapter sandbox not starting. Startup refuses a runner whose bubblewrap cannot start that sandbox. - A trial's launch plan refused for what its adapter is (its tools beside text_only, a dsh server name made of a long id) is adapter_failed, scored 0, for a trial and for a stream's step; with no adapter it is still the config's error. - A provider that does not bill the account (a 402, its quota or credit spent) ends the run, as an API account's usage limit does. Before, every later trial ended model_rejected. - acting_agent.settings.env refuses a secret's $NAME inside a value by every rule (AUTH, PASSWD, Harbor's), and a secret's value written as it is. `effort: off` gives no effort flag, as on main. - The answer agent writes answer.json as a new file renamed into place, never through a link the container left there. Codex's auth.json is removed from the container once it has been copied back, before a verifier that shares the container runs. - The curated log's top stream is the one the launch plan names. The report adds a note when results.jsonl was written after summary.json, as by an eval stopped beside an earlier summary. The runner's finalizer gives each driver 2 minutes (CLOSE_STOP_S) before it kills it. - Tests for each fix above. They also catch four mutations no test caught before: the turn's sign-in copy, the first give-up reason, Codex's outage reading, and the report's errors comparison. - Docs that did not match the code: what `hermit eval` reads of a config made for it alone, the causes never run again, only a first step starting a finished stream over, the CLI Evolvers' run_agent, the stream socket's path, split files with more than one rollout, Harbor's own usage-limit error, when the `login: claude` warning fires, a quoted line in Codex's own form, the relay's sandbox, the deployment record's host paths, and hermit check's probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
Main has gained Hermes Agent as a CLI Base Agent (#107, 616e818) since this PR's base, e813538. In the rebase, each conflict keeps both sides: #107's Hermes in the docs' lists and tables of CLIs, and this PR's Harbor beside it. A Harbor trial does not run Hermes: the runner refuses `acting_agent.cli: hermes` at startup, as it refuses any CLI with no HermitXXX class, which a new test holds. The docs now say so (the acting agent's row in docs/framework/task.md, the CHANGELOG entry), and FRAMEWORK_SUPPORT.md counts five other hosts that take `serve_tools`, Hermes's among them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
… gate held The round-11 audit of a332854 found no high or medium issue; these are its low ones and what its questions found. - A Pi or dsh trial's developer_role is the backends registry's only for the backend the registry has at the trial's URL (launch._with_role): the run config's `backends:` is not the runner's to read, where Hermit's own sessions take it. FRAMEWORK_SUPPORT.md (candidate 14), docs/framework/task.md and the changelog said the trial got what Hermit's sessions get; they now say where it does not, and a test holds the URL check, on both of the spec's paths. - acting_agent.settings.env refuses a value given as it is to a variable a word of whose name is a secret's wherever the word stands (HF_TOKEN_READ, OPENAI_API_KEY_2, SECRET_ID), not only at the name's end (launch.SECRET_VAR); a word that only holds one (GIT_AUTHOR_NAME, TOKENIZERS_PARALLELISM) is no secret. A test now holds Harbor's part of the rule for a `$NAME` inside other text ($OAUTH_CLIENT_ID). - The verdict of a trial, or of a stream's first step, that a disk gate held back names the gate that held it, the host's /tmp or Docker's data root; it named the data root whichever held it. - Tests for what none caught: the answer agent's relay's 402 whatever its words, the stop a runner's close gives each driver (CLOSE_STOP_S), a job folder this process cannot write (the host check after a failed staging child). - docs/framework/task.md says what the questions found: a login's wait for its plan has no bound, a request the plan held back at any time makes its timed-out trial infra, a refused session runs again as often as the plan refuses, the host check comes after the staging child, and N hung drivers hold a close up N x 2 minutes. The changelog's Codex refusal no longer reads as every 400 or 404. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
iamziyuzhao
force-pushed
the
harbor-foundation
branch
from
November 17, 2026 14:49
e19d155 to
6a79375
Compare
iamziyuzhao
added a commit
that referenced
this pull request
Nov 17, 2026
…hods Terminal-Bench 2.0, SWE-bench Verified, AlgoTune, Terminal-Bench-Science and LAB-Bench FigQA through Harbor, each a benchmark file (the registry's task set, locked), a baseline per profile (Codex with GPT-5.6-Luna on a ChatGPT login, Claude Code with Claude Haiku 5.5 on a Claude subscription) and the method whose paper's protocol fits it: the AHE Adapter on Terminal-Bench 2.0 in the AHE paper's in-sample protocol, trained on each task's rollouts #1 and #2 and tested on #3 and #4; its final adapter, frozen, on SWE-bench Verified and Terminal-Bench-Science against AHE's seed; SkillOpt in its paper's protocol on AlgoTune, a trial scored 1 - 1/speedup so that the mean gives AlgoTune's harmonic mean (a success, by which SkillOpt's analysts and slow update sort the rollouts, a solver faster than the reference), and on LAB-Bench FigQA, whose download is patched: the published tasks save the shuffle's seed where the agent reads it, which gives the answer away, and their verifier runs a script the agent can rewrite. LAB-Bench's test questions whose figure no training question has are listed for a second score from the same trials (utils/figures.py reads an eval's results). Every run is the framework's own commands on a config, as on main: a baseline is a config for `hermit eval` alone (`--adapter none`, or an adapter directory: a transfer's, or AHE's seed as the template's directory), whose training keys are placeholders (its Evolver, `eval-only`, one that `hermit train` does not find); a method is `hermit train` and then `hermit eval --adapter final` (and `--adapter root` for its seed or empty skill where no baseline tests it, an adapter of the same run's tree); a whole benchmark's test is an override of the same config (`data.test=../utils/splits/all.txt` with its own run name). An eval's number is the pass@1 that `python -m hermit.harbor.report` gives over the trials that are the agent's result: #105's runner runs an infra trial again, then records a failed run, 0 in `hermit eval`'s mean. AlgoTune's harmonic mean and LAB-Bench's second score read the rows the same way, and say when an eval did not finish. No trial is taken from an earlier run: there is no trial cache. SkillOpt's configs give its analysts no Codex trace summary (it describes SkillOpt's own harness). Every learner on a login waits for the plan's window (`plan_max_wait_s: null`); AHE's learners' clocks count the wait, as on main. examples/README.md says what a machine needs (bubblewrap for every run, a baseline's too) and lists every run with its trials, to be handed out; examples/conftest.py keeps `python -m pytest` out of a prepared task set and a run's `runs/`, and examples/.gitignore keeps the task sets' links out of git; tests/core/test_harbor_examples.py holds the protocols to the committed files (every learner's wait for the plan among them), loads every config as its command does (a baseline's refused by `hermit train`) and builds #105's runner from each config's settings, its startup checks included (this machine's sign-in and bubblewrap stood in for). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
…ls for good The audit of 6a79375 found one high and four medium issues and fifteen low ones. This fixes the high and medium ones, and fourteen of the low ones (one is in the PR's description); the last is noted there. - High: a stream's next pass (an eval's next repeat) could meet the driver of the pass before in the half second between its last answer and its exit, take it for a live one, and lose the whole pass. The driver's record now says it is ending before its last answers (harborside.driver._mark_ending); StreamClient.running takes neither such a driver nor one killed and not yet reaped, and ensure() waits up to 30 s for an earlier driver to exit, then kills it, before it starts the next. - Medium: a step whose own folder this machine cannot make now gives its stream up (host_failed), so its driver is stopped and the next pass starts anew. Before, the driver waited for that step, and the next pass ran its last step on the old environment. - Medium: a step's curated log walks the agent's folders through open directory handles and opens each entry with O_NOFOLLOW (curate._files, and open_regular for the files at its top). A link that a process the agent left running swaps in while the stream's environment stays up is never followed, and a file gone meanwhile is left out without an error. - Medium: Codex's refusals for good are read in its own words: a provider's error body Codex passes on as it is, "model is not supported", and its plan refusals (a workspace out of credits, a spend cap, a plan without Codex). The plan refusals end the run, as a 402 does. - Medium: the answer agent's relay reads a 429 for a spent quota (OpenAI's insufficient_quota, as its code or its type) as the bill's refusal, which ends the run, not as an outage that runs again. - Low: - A relayed Codex session that main's reader leaves a 502 but whose stream says it was refused for good is a 400 with Codex's words. - The disk gate's verdict names the room for the task's image and for other trials' pulls, and a stream's first step keeps room for its image until its environment is up. - A step waits for its turn over the earlier steps' own budgets. - Refused at startup: a benchmark file's {cli} model without a login, which the runner cannot bind, and a login in acting_agent.settings. - A relative mini-swe-agent settings.config is read beside the params, as the runner's other paths are. - The texts on the line reader, the secret-name rules and their tradeoff, the time a kill takes at exit, the answer agent's effort, and a Harbor Claude session's token (on a descriptor). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
iamziyuzhao
added a commit
that referenced
this pull request
Nov 17, 2026
…hods Terminal-Bench 2.0, SWE-bench Verified, AlgoTune, Terminal-Bench-Science and LAB-Bench FigQA through Harbor, each a benchmark file (the registry's task set, locked), a baseline per profile (Codex with GPT-5.6-Luna on a ChatGPT login, Claude Code with Claude Haiku 5.5 on a Claude subscription) and the method whose paper's protocol fits it: the AHE Adapter on Terminal-Bench 2.0 in the AHE paper's in-sample protocol, trained on each task's rollouts #1 and #2 and tested on #3 and #4; its final adapter, frozen, on SWE-bench Verified and Terminal-Bench-Science against AHE's seed; SkillOpt in its paper's protocol on AlgoTune, a trial scored 1 - 1/speedup so that the mean gives AlgoTune's harmonic mean (a success, by which SkillOpt's analysts and slow update sort the rollouts, a solver faster than the reference), and on LAB-Bench FigQA, whose download is patched: the published tasks save the shuffle's seed where the agent reads it, which gives the answer away, and their verifier runs a script the agent can rewrite. LAB-Bench's test questions whose figure no training question has are listed for a second score from the same trials (utils/figures.py reads an eval's results). Every run is the framework's own commands on a config, as on main: a baseline is a config for `hermit eval` alone (`--adapter none`, or an adapter directory: a transfer's, or AHE's seed as the template's directory), whose training keys are placeholders (its Evolver, `eval-only`, one that `hermit train` does not find); a method is `hermit train` and then `hermit eval --adapter final` (and `--adapter root` for its seed or empty skill where no baseline tests it, an adapter of the same run's tree); a whole benchmark's test is an override of the same config (`data.test=../utils/splits/all.txt` with its own run name). An eval's number is the pass@1 that `python -m hermit.harbor.report` gives over the trials that are the agent's result: #105's runner runs an infra trial again, then records a failed run, 0 in `hermit eval`'s mean. AlgoTune's harmonic mean and LAB-Bench's second score read the rows the same way, and say when an eval did not finish. No trial is taken from an earlier run: there is no trial cache. SkillOpt's configs give its analysts no Codex trace summary (it describes SkillOpt's own harness). Every learner on a login waits for the plan's window (`plan_max_wait_s: null`); AHE's learners' clocks count the wait, as on main. examples/README.md says what a machine needs (bubblewrap for every run, a baseline's too) and lists every run with its trials, to be handed out; examples/conftest.py keeps `python -m pytest` out of a prepared task set and a run's `runs/`, and examples/.gitignore keeps the task sets' links out of git; tests/core/test_harbor_examples.py holds the protocols to the committed files (every learner's wait for the plan among them), loads every config as its command does (a baseline's refused by `hermit train`) and builds #105's runner from each config's settings, its startup checks included (this machine's sign-in and bubblewrap stood in for). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP
… and stop - build_tasks.py imports task_text from utils/task.py (the module it named is gone) - Claude Code on a backend that needs no key gets its placeholder token - the answer agent's Codex model has web_search off unless given - a row without an instruction gets Harbor's instruction for its context - a benchmark's patch is loaded without writing __pycache__ beside it - a launch's plans folder is the user's only (0700) - curate opens a reward file and hermit-copy/memory without following links - an answer trial whose agent sent no request costs 0, not unknown - a spent quota ends the run even when the agent's time ran out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
haizhongzheng
approved these changes
Nov 18, 2026
Member
There was a problem hiding this comment.
Thanks for this. Every CLI now runs in the task's container through the commands and configs we already have, and secrets are passed only by variable name. We reviewed 849f5a2 with two independent reviewers over five rounds and pushed one commit on top, c487378:
build_tasks.pyimported a module that no longer exists, so rebuilding the OfficeQA tasks crashed. It now importstask_textfromutils/task.py.- Claude Code on a backend that needs no key, such as vLLM, was refused at launch. It now gets the backend's placeholder token.
- When the answer agent ran on a Codex model and
web_searchwas not set, every request failed. Web search is now off unless set. - A task row with no
instructiongot the wrong query for its context. It now gets the instruction Harbor gives the agent. dataset preparewrote__pycache__next to the benchmark's patch file. The patch now loads without writing bytecode.- The launch's plans folder holds the relay and tool tokens and is now readable only by the user (0700).
- Curation copied a reward file, or
hermit-copy/memory, even when it had been swapped for a link. Both are now opened without following links. - An answer trial that failed before sending a request had its cost recorded as unknown, which made the eval's total cost unknown. It now costs 0.
- A spent quota did not stop the run when the agent also ran out of time, so every later trial waited for its timeout. The run now stops.
Noted, not changed
- Stream steps on a subscription sign-in bypass the quota hold. The PR already documents this as a limit.
- A stream step can copy the sign-in before the previous step has taken it back. A stream driver killed mid-run leaves its compose project up. A step with no tools keeps the previous step's tools.
- dsh's 401, OpenCode's 402 and mini-swe-agent's billing refusals are read as agent failures. This belongs to main's Base Agent readers, and
FRAMEWORK_SUPPORT.mdalready lists it. - The relay's retries drop usage reported in error replies. The disk gate reserves the same image twice. Two concurrent prepares can patch one cached set.
Tests: Harbor's tests, test_deploy and OfficeQA's harbor judge pass: 362 passed, 2 skipped (the smoke tests need Docker). CI passed on c487378.
🤖 Generated with Claude Code
haizhongzheng
added a commit
that referenced
this pull request
Nov 18, 2026
…hods (#106) * Shared layers: a Harbor trial of any CLI is deployed, bound and read as Hermit's own sessions are What the Harbor runner needs of the layers every method shares, so that a trial in a task's container is one more session of the CLI's Base Agent: - The hosts deploy for a caller that serves the adapter's tools itself (`--no-serve-tools` on every host; Pi's and dsh's `prepare(serve_tools=False)` names no server, and the acting agents' workspace now passes the flag on, so a container session of Hermit's own runs gets no server row it cannot start) and take one task's context (`--context-file`). - Every CLI Base Agent reads a stream its caller read elsewhere: `outcome()` with no stream file reads the stream's text as it reads the file, the reply included; a missing or empty stream is a session not served, never a TypeError. - A Codex session whose sign-in or key the provider refused is `login_failed` (the run stops) if its turn did not complete, read from its own notices: never one it recovered from, what its log quotes of the session's tool calls, or an event's text (U+0085, U+2028 and U+2029 end no line of a stream); `unavailable` comes from its last failure. Codex's records are read with span prefixes too (`RUST_LOG=codex_core=info`). - hermit.agent.base.trajectory, the AHE Debugger, Harness²'s bench, RRSI's render and SkillOpt's Codex trace read a Harbor trial of any CLI (`agent/agent-<backend>.jsonl`, then Harbor's own output files, then its ATIF trajectory, which the Debugger takes before those files), and AHE's texts (EVOLVER.md's too) name that trial's files (the stream, hook audit and state under agent/; the record's instruction, as the Debugger's `task0i.md`; START.md's tree). Harness²'s bench takes a Claude Code trial's final message as the Base Agent reads its reply. MWM counts a learner session's turns and actions from the events the common reader reads (a line of the CLI's own that is no JSON object, or an event holding U+2028, no longer fails the step) and finds a task's record by the material's own file name. - A Harbor acting agent's model is bound and checked in the acting CLI's dialect (`agent (harbor, <cli>)`, an endpoint's too), the whole Binding spec kept, developer_role included, and its login is a contained session's (logins_of) unless `claude_bin` names this machine's Claude Code, whose version is then checked; the task set's benchmark file counts for both, as the runner merges it (relative to `normalize_config`'s `base`, else the working directory). hermit.harbor.clis is the table of those CLIs. - A client of a CLI's chat endpoint counts what a session that failed or that the provider refused used, which the endpoint reports in its error body (ChatClient's `count_error_usage`, set by `endpoint_spec`). tests/selection.py counts the recorded OpenCode and dsh streams as shared: the methods' tests read them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Core: infra runs, configs for hermit eval alone, and a multi-step task's steps in order What a Harbor task set needs of the framework's own commands and configuration. There is no new way to run: training is `hermit train`, testing is `hermit eval --adapter ...`, each set by the run's YAML and overrides as before. - A run that is not the agent's result (`RunOutput.extra["unscored"]`: a Harbor trial of status infra) has status `infra`: never judged, its score null in steps.jsonl, left out of the Trainer's and `hermit eval`'s means and counted (`unscored`, in the summaries, the learning material and the card). `eval.infra_retries` and `eval.infra_wait_s` make `hermit eval` run such rows again, except a multi-step task's step rows, a task Harbor runs for none of Hermit's agents (`unsupported_task`) and any after a halt (a lost login, a usage limit). - `hermit eval` needs only what it reads (`data.tasks`, `data.test`, the agent, the judge): a config with no `data.train`, such as a baseline's, needs no template or Evolver; `hermit check` checks it as `eval` runs it (its probe on a test row), `hermit train` refuses it, and its run name is the config file's when `trainer.run_name` gives none. An adapter of the run's tree (`final`, `root`, a tag, a commit) needs that tree: without one, `eval` refuses it before any run. The `eval` section is checked where an eval runs. - With `eval.repeats` above 1, each repeat hands the pipeline copies of its rows that name it (`repeat`), so that a pipeline that keeps its trials by row (Harbor's trial cache) runs each repeat anew; results.jsonl names the repeat. With `trainer.epochs` above 1 each epoch's rows name the epoch (`epoch`), and the rows `run_agent` runs, and those of a task the epoch's order names twice, ask for a new run (`fresh`): such a pipeline runs each anew, an epoch on an adapter the one before left unchanged included, where it would have handed back the earlier trial. - A multi-step Harbor task's steps run in order in its stream: `data.shuffle` moves its rows as one; a split whose order is kept (the train split with `data.shuffle: false`, the test split, the validation split) that lists a step ahead of an earlier one, or without every earlier one, is refused before any run, and `hermit check` reports it; `next_tasks` may name a step only after the earlier ones; `run_agent` runs no training row that is such a step, and an id it does not run comes back as an error result (score 0), no longer an exception; Harness² fails such a step before any editor session, and records an infra execution's cause beside its null score. A run runs each step of a stream once, in one environment: a train split with such steps trains one epoch (`hermit train` refuses more, and `hermit check` reports it). `hermit check` checks the test split's order for a training config too, and its probe runs no later step. - The Harbor task set's tasks and jobs directories, and an eval config's tree, are run secrets. The Harbor agent is told what its streams are named for (`run_identity`: a training run's record directory and the id it keeps there, any other pipeline its own), whether they are kept for a resume (`keep_streams`: the Trainer's pipeline only, until the run finishes), the run its trials are kept to (`trial_scope`: the Trainer's pipeline only, that identity), whether the run deploys adapters, and the CLI and login of a model only a CLI reaches; `hermit check`'s probe takes no trial from the trial cache. - An acting agent of Harbor's own takes no adapter: `hermit train` refuses it, `hermit eval` runs it with `--adapter none` only, and `hermit check` reports it for a training config. tests/core/test_harbor_core.py covers these. What this commit hands the Harbor agent, the next commit's runner takes: three of these tests (Harbor's `dataset prepare`, and a pipeline closing its HarborAgent with its streams) pass from there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Harbor: every CLI in the task's container from one launch plan, with the adapter's tools, context and notes A Harbor trial ran only Codex well (and Claude Code through code of its own); the adapter's tools, a per-task context and an adapter's notes never reached the container, and infra trials counted as zeros. Now: - One HermitXXX class per CLI (hermit.harbor.clis: codex, claude, pi, opencode, dsh, mini-swe-agent) over one executor (harborside/hermit.py). Hermit's side renders each trial's session with the CLI's own Base Agent (hermit.harbor.launch: the home, the command, the environment; host paths made the container's) against the adapter deployed as `hermit deploy` lays it out, and harborside uploads and runs it as the task's agent user: the prompt on stdin, the stream in agent/agent-<backend>.jsonl, the deployment record always there (so an adapter's hooks run on Codex too, HERMIT_HOOK_LOGS set), a session still running at Harbor's timeout killed with its process group. The steps after the session still run past that timeout, and keep the session's own error when the timeout lands in them; a copy that failed is dropped, never kept in part. A `<cli>_bin` serves only at the asked-for version and when the agent user may execute it. The runner reads the stream back with the same Base Agent: reply, served, the plan's or the provider's refusal, the usage at `agent.params.price`, else at the backend's price. - The adapter's tools are served from this machine on the Docker bridge's gateway (hermit.harbor.tools, every call logged); a per-task context is computed in the adapter sandbox (hermit.harbor.context); an adapter's notes come back after the session (memory/ in the log). - A key or a token reaches the container by its variable's name only (`docker compose exec -e NAME`; Claude Code's subscription token on a descriptor), never in a command line, a file, the plan or a log; Codex's ChatGPT sign-in is a file of its home there (mode 600). Codex and Claude Code run on the user's subscription (`login: chatgpt | claude`) in the plan's slots and holds, each trial noting the plan's usage (so `MAX_USED` holds trials back): a refused session again after the window, one the provider could not serve after a pause unless it ran out of the agent's time, a lost sign-in never, none once another trial halted the run; the trial's usage is every run's. Codex's refreshed sign-in comes back and becomes the shared copy. A task whose agent network is not public gets the model's and tools' hosts allowlisted and web search off; `web_search` must be set. - The answer-only agent (`cli: answer`) makes one model call through an endpoint the runner serves and writes the answer into the container (LAB-Bench's questions); a request still in flight when the trial ends is given up, its cost unknown, and on a model a CLI reaches on a login the trial waits for that plan first (a request the plan held past the agent's time is infra, `usage_limit`). A question or attachments it cannot read fail the launch. - The judge scores the verifier's reward whenever the verifier gave one, a timeout or an agent error included (Harbor's own mean), says "passed" at `pass_reward` (null for a score scale) and leaves out what `verifier_redact` matches. Not the agent's result, so unscored (infra): a verifier whose tools never downloaded or that hit a full disk, harborside's launch failing (HermitLaunchError, the CLI's install included), a session that never started or whose tools never came up, a lost sign-in, a Claude Code, Pi or OpenCode session or an answer request the provider refused for the run's configuration before serving any (its key, model, bill or a setting it does not take: `model_rejected`, no halt), a task Harbor runs for none of Hermit's agents (MCP servers, a skills folder, a Windows container: `unsupported_task`, never handed to Harbor; the set's other tasks run). A trial out of the agent's time is the agent's even after a provider notice, and so is a request refused for its input; the adapter's context over the CLI's limit beside the image's own is the adapter's 0, and so is a session the model's safeguards ended. With `verifier_timeout: agent` (a verifier that times the agent's solution, as AlgoTune's does) a verifier out of its time is the agent's result, and Continual Harness's Refiner reads it as that, not as a session past its clock. - Startup refuses what every trial would: a login for another CLI, a login and a binding at once, a loopback model, a missing key or sign-in, a non-Docker environment for secrets by name, a plan the Base Agent cannot render (mini-swe-agent's: web search, a model class Hermit does not read), a `harbor` that is no executable file, mini-swe-agent without its package for a run that deploys adapters, the answer agent's attachments on a model a CLI reaches. Harbor's own claude-code gets a bound model's Messages API root (it was sent to /v1/v1/messages), keeps Harbor's per-task web rule unless `web_search` is false, and is refused the subscription (`CLAUDE_FORCE_OAUTH`, or the subscription's token as its only sign-in). - `python -m hermit.harbor.dataset prepare` makes an example's data from its benchmark file's `dataset:` block (the registry's tasks, rows, splits, smoke rows, a patch, the images' sizes with `image_sizes: true`, a lock). A download is moved into place only once whole, and what is in its way is refused first; a relative `data:` is the benchmark file's folder's. The lock and the download record the tasks' source (a download of another source is never reused, and the default data directory is the source's own); the lock holds no path of this machine and hashes only a mode's executable bit (one written under a umask other than 022 needs writing again); an unreadable lock is refused unless `--force`. - Also, from the Terminal-Bench 2.1 runs: a host failure (Docker's, the host's /tmp full) is infra and no trial starts while /tmp is short; the trial of a task whose name is longer than 32 characters is found; a `harbor run` past its wait budget is killed and its trial's compose projects, the verifier's too, taken down by name alone (no compose file or `COMPOSE_*` variable read). A stream's step runs its own plan, its verifier read as a trial's; each `hermit eval` repeat and each run gets streams of its own, stopped when the run ends unless a `hermit train` may resume them. The trial cache keys the launch, the whole row, the task's files, the model's price and the adapter as deployed (a file's executable bit, not the bits a umask sets; not the adapter's card, which no deployment copies, so a final adapter tested again meets its trials); a cached trial costs nothing again; a training run's trials are its own (only the run, resumed, meets them) and each epoch's too, a row asking for a new run (run_agent's, a task a split names twice) is neither taken nor kept, and `hermit check`'s probe neither takes one nor keeps one. The benchmark file's price applies to its own model, and a model the config gives as an endpoint mapping keeps its own price. - OfficeQA's Harbor judge reads the final message from HermitCodex's stream (`agent-codex.jsonl`): a task set built before needs building again. - Docs and CHANGELOG for the whole change (the framework's task, configuration and command pages; the methods' pages; the Breaking entries: the runner's `codex_login` is gone, `login: chatgpt`; a table CLI's trial needs `web_search`; secrets by name run on local Docker only). Checked in real containers on this machine, each run a `hermit eval` of a config for it alone: Codex on the ChatGPT login (no adapter; tasks with an open and a closed network; the adapter's MCP tool, AHE's hooks, Continual Harness's notes, ASPIRE's template) and Claude Code on a subscription token (an instruction that begins with `/`, the MCP tool, AHE's hooks); Pi, OpenCode, dsh and mini-swe-agent on a scripted model; the answer agent; a three-step stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: the post-PR audits of 2d9401c and 3aa0cc2 The post-PR audit of this PR's 2d9401c found one high issue and six medium ones, and the audit of #106's 3aa0cc2 one medium issue in this PR's code; each is fixed here, and so are five of the low ones. - Claude Code on Anthropic's own API with a key (`acting_agent: {cli: claude}`, `anthropic/<model>`, no login) started every session without a token: the launch script exported the plan's empty ANTHROPIC_API_KEY before ANTHROPIC_AUTH_TOKEN read the key from it. A variable the plan passes under another name is now set first, in one export that reads every source as Harbor passed it; a source no entry sets is unset, and the plan's own variables come after. - A Harbor halt (a lost sign-in, an API account's usage limit) ends `hermit train` unfinished at the step that met it, before its learner (after the learner's call when a run of `run_agent`'s met it), and a resume runs that step again: before, every later rollout came back infra/halted while the learner went on, and the run ended as finished. - Whether the provider could not serve a Codex session is read from its last failure since the session last worked, never from a warning of Codex's (the trust it gives a deployment's hooks), and a turn that failed, or a stream that ended, while Codex retried its requests is one it could not serve, unless the sign-in was lost: Codex 0.164 that cannot reach chatgpt.com fails its turn with `workspace routing discovery failed`, which the last-failure rule had made the agent's empty answer. Codex 0.164's own words for a lost sign-in are matched. - A ChatGPT sign-in a session hands back replaces the shared copy only as a later, well-formed refresh: a regular file of at most 64 KiB (a container's larger one is never downloaded) holding its refresh and access tokens, for the copy's account, stamped after the copy and at most a minute ahead of this machine's clock (an hour where the clock may differ). Harbor no longer gets CODEX_FORCE_AUTH_JSON or CODEX_AUTH_JSON_PATH from the user's environment. - Only a pipeline that keeps its trials by row (a Harbor task set with `trial_cache` on, in the config or its benchmark file: isolate.keeps_trials) is handed rows naming their epoch or asking for a new run; no record keeps `epoch` or `fresh` (rollout.TRIAL_KEYS), so the learning material's `input` and every learner's text of a task are the same in each epoch, and the adapter's per-task context gets the task's own row. - A Harbor trial is scored as Harbor grades it: a verifier that left no reward Harbor could read or ran out of its time (`verifier_timeout: agent`, now the default; `infra` the opt-in for a host whose load makes verifiers time out), and a request of one of Harbor's own agents that the provider refused for what it held, are the agent's result, 0 without a reward, unless the verifier's output shows its tools never arrived or the host's disk full; a provider that could not serve, or refused the run's configuration, stays infra (Hermit runs it again, where Harbor grades it). An OSError on this machine while the adapter is staged is infra (`staging_failed`); the adapter's own deployment or per-task context failing stays the agent's 0, since what its child process prints could be the adapter's words. A verdict that quotes the verifier's output applies `verifier_redact`. - `dataset prepare`: a patched set is its patch's own. The download record names the patch (its hook and its file's digest), a reuse of another source's or another patch's tasks is refused before the patch runs, the default data directory is named by the patch too (an unpatched set's name as before), and a download is patched in its own folder before it is moved into place. - The AHE Adapter's learners' clocks (`evolve_timeout_s`, the Agent Debugger's `timeout_s`) are the Base Agent's own, counted from the CLI's start: a wait for the login's plan or a session slot pauses them instead of spending them (a hold longer than a clock made the step a no-op recorded as done, or the Debugger's analyses upstream's fallback text). This reverses PR #65's choice that the Debugger's clock cover the plan wait: upstream's clocks had no plan hold to cover. `trainer.call_timeout_min` still bounds a step, waits included. - `hermit train`'s refusal of more than one epoch over a multi-step task's steps gives its true reason. Tests: test_harbor_harborside.py (every CLI's launch script on every backend run by bash, the returned files' limits), test_harbor_runner.py (grading as Harbor does, staging, redaction, the sign-in back by the environment's clock, Harbor's environment, a Codex outage), test_harbor_core.py (the rows only a trial cache is handed, the records, a halt), test_harbor_dataset.py (patched sets), test_cli_agent.py and test_base_agents.py (Codex's outcome and lost sign-in words, the take-back), tests/methods/ahe (both clocks through a real login path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: the post-PR audit of fe8c5b4 The post-PR audit of this PR's fe8c5b4 found two medium issues and eleven low ones; each is fixed here. - A step of a multi-step task whose turn cannot come ends infra (stream_order) at once and starts no driver: its stream's driver waits for a step no rollout of the runner is running (one that ended before it reached the driver, or ran in an earlier training step), or the stream has no driver and no rollout of its first step is running to start one. Every later step of the stream ends the same way, and the last of them stops the driver. Before, each waited out its turn (by default its budget for each earlier step and an hour more), holding a rollout's worker, then ended infra, so a step that failed on this machine before it reached the driver, a halt (whose resume reran a later step on a new driver at step 1) or a driver gone lost the rest of the stream after hours. The runner keeps each stream's steps in flight; StreamClient.wait_turn takes what it asks. - `trial_cache` with an answer agent on a model a CLI reaches (`model: {cli, model, login}`): the trial's key held the URL of the endpoint the run's pipeline serves the model on (its port and token, and the binding's `messages_url` derived from it), which no resumed run or other eval has again, so no trial was ever taken from the cache. The key names that model by its CLI and login. - A new stream driver in a directory that held one sets the earlier one's trial and replies aside (`earlier/<n>/`): Harbor reuses a trial's step directories, so a step of a stream run again that left no output of its own was read, and billed, as the earlier run's. - A stream driver that answers no stop within 15 minutes (hung in a step) is killed with its process group, and its trial's compose projects are taken down by name. - An OSError on this machine while a trial's job and launch are written (its job directory, the launch plan, the agent's config, job.yaml), or a stream step's launch plan, is infra (`staging_failed`), as one while the adapter is staged is: before, it raised out of the rollout, the agent's 0. - A rollout that never reached a container (a halted run's, the disk gate's, an unsupported task's, a staging that failed, a stream step its driver was never asked for) costs 0: before, its cost was unknown, which left the eval's total cost unknown. A stream step lost after its request was sent keeps an unknown cost. - The ChatGPT sign-in's take-back reads the shared copy's own stamp as any accepted copy may hold it (at most an hour ahead of this machine's clock, as one from the user's own file), never as no stamp: an earlier file a session handed back replaced a copy stamped ahead of this clock. - Codex's fall back from WebSockets to HTTPS retries nothing, so a request refused after it is the session's own failure; only its reconnects (`Reconnecting...`) are retries. - `hermit eval` of a split that names a task twice keeps a row for each, as on main (the infra reruns kept the records by id). - `<jobs_dir>/HALT` names the record's cause first (`login_failed`, `usage_limit`) and says that it halts every run on that jobs directory, as the docs now do. - The docs: a sign-in file is checked for its size before it is downloaded (one grown after the check is refused when taken back); with Harbor's retry on, a failed attempt's usage is not counted; what `staging_failed` covers. The CHANGELOG's Harbor entry is rewrapped where earlier edits had cut its lines short. Tests: test_harbor_runner.py (a stream's lost turns, at once and in order, a halt's resume, a rerun's outputs, a hung driver, a stream step's launch, a lost step's cost, the CLI model's trial key, a trial's staging, a never-ran rollout's cost, the halt file), test_harbor_core.py (a split that names a task twice), test_cli_agent.py (a copy stamped ahead of this clock), test_base_agents.py (Codex's fall back). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: the post-PR audit of 3a49adc The post-PR audit of this PR's 3a49adc found three medium issues and fifteen low ones; each is fixed here or, where it is a limit of the design, recorded in the PR. - `trial_cache` with a model a CLI reaches: 3a49adc named that model by its CLI and login alone, so a second eval on the same jobs directory whose CLI had another effort, `bin` or version met the first one's trials. The key also holds the CLI's identity (`hermit.agent.base.endpoint.cli_identity`: its settings as its sessions get them, less where they run and log and which plan they wait for, and its binary's path, size and time of change), as a digest that hermit.isolate.agent_pipeline hands the runner (`model_cli_identity`). Harbor's `retry`, the adapter sandbox's `sandbox_enforce` and `tools_host` are in the key too. - A trial whose agent ran out of its time or exited with an error is verified by Harbor and graded: when its verifier's tools then never arrived (a 5xx of GitHub's release download) or met the host's full disk, it is infra and run again, as one whose agent finished is. Before, it was the agent's 0 and stayed in the trial cache. - Codex's words for a refresh of the ChatGPT sign-in the provider refused ("Your access token could not be refreshed [because your refresh token was already used / has expired / was revoked]. Please log out and sign in again.") are a lost sign-in: the run halts. Before, the trial kept Harbor's verdict, scored 0 and cached. A sign-in refusal counts only since the session last worked: one on a side request the session worked after is none. - `run_tasks` submits each multi-step task's steps in step order, in the places its steps had: a `run_agent` call that listed a later step first, with fewer workers than the gap, gave the stream up and lost the earlier step too. - A step whose stream aborted before its turn is never asked for (`wait_turn` checks the abort first), so it costs 0; and a trial whose environment or agent setup failed before its agent started (Harbor records no `agent_execution`) costs 0. Both had an unknown cost, which left the eval's total cost unknown. - An OSError on this machine past the guarded steps (no process left to start `harbor`, a file it cannot write or read) is infra (`host_failed`), its cost unknown, not the agent's error scored 0. A trial cache this machine cannot write leaves the trial as it ended (it stands, uncached), an entry it cannot read is no trial kept, a key whose dry render cannot be written runs the trial without the cache, a sign-in take-back that fails leaves the trial as it ended, and a HALT file it cannot write leaves the halt to the rollout's output. - A stream step run again sets the tool-call log an earlier run of it left aside (`earlier-<n>-tool-calls.jsonl`) at its turn, so its curated log holds its own calls only. - A killed stream driver's socket is removed. - Only a Harbor task set's rows name their repeat (`repeat`, with `eval.repeats` above 1), and no record's `input` keeps it; a record's `input` drops only the keys its caller added (the Trainer's `epoch` and `fresh`), so a row's own field of those names stays. Every other pipeline gets its rows and records as on main, and a Harbor adapter's per-task context never reads `repeat`. - A failed `hermit eval` removes the earlier eval's `summary.json`, as it empties `results.jsonl`. - The overlap error of a declared path names a Harbor task set's directories as such. - The docs: `solved_once` counts each test id once; the steps of `run_agent`'s call run in step order; the cost of a trial that never started an agent; `host_failed`; the Codex refresh refusal and what to do about it; a copy stamped ahead by another clock is replaced once this clock passes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: the post-PR audits of e7ace26 and b709e0c The post-PR audit of this PR's e7ace26 found no high or medium issue and eleven groups of low ones; the audit of the benchmarks PR stacked on it (b709e0c) found a medium issue here and a low one. Each is fixed here or, where it is a limit of the design, recorded in the PR. - `python -m pytest` imported the files of a run's folder beside an example's configs (`examples/*/runs`, their output_dir), a task container's and a learner's files among them, and ran them on this machine outside any sandbox: the root conftest ignores them, as it ignores a Harbor task set's. - A pipeline that deploys adapters is refused at startup where bubblewrap is not installed and the adapter sandbox that renders each adapter is required (`agent.params.sandbox_enforce`): each trial ended in the sandbox's error, scored 0. - A rollout that met a halt (a lost sign-in, an account's limit) and then an OSError of this machine (its curated log not written: a full disk) came back `host_failed` with no halt, so that nothing halted where its HALT file could not be written either: it keeps the halting verdict. A jobs directory this machine cannot make is `host_failed` at a cost of 0, not an error scored 0. - A stream step whose turn never came curated the tool-call log an earlier run of it left as its own: it curates none. - A verifier's words of a full disk (ENOSPC) made a trial infra even after its tests ran: now only before its tests wrote a report (`ctrf.json`), so that a test's own output (an agent's program, a task about a full disk) stays the agent's result. - The copy-back and the collect ran as root in /logs/agent, which every user can write in, through a link the agent's user could put there, and made what it named readable to all: each makes a new folder of root's, enters it, checks that it is that folder, and works in it by relative names. - `acting_agent.env` is written into each trial's job and onto `docker compose exec`'s command line: a variable of a secret's name, or a value naming one, is refused at startup. - The `tasks` link is followed once (`tasks_dir`), so that a prepare pointing it elsewhere mid-run changes neither a trial's task set nor the key it is kept under; a task's link to a folder is in its digest by where it points. - A codex, claude or pi trial of a model a CLI reaches got the loopback refusal once the pipeline served that model: it is refused for what it is. - A row of its own `epoch`, `fresh` or `repeat` field is refused where the framework adds those keys (hermit train with the trial cache, hermit eval's repeats of a Harbor task set; hermit check says so too): they would replace it, and no record would keep it. - `dataset prepare`: a data directory that is the set's own folder in another download is that download's (its marker is beside it), refused to a benchmark of another patch; a download is marked in its own folder before the set is moved into place; an image whose size cannot be read anew keeps the earlier one; split counts are whole numbers, and a smoke task is named once; the rows, the lock, the splits and the sizes are all made before any is written, so that a refusal leaves the link and every file as they were; a `data` naming a variable that is not set is refused; this machine's errors (an OSError, Harbor's failed download) are the command's `error:`, exit 1. - An ATIF trajectory's tool-call id that is no string (a list, an object) reads as no id, never a TypeError in each learner reading the log. - Tests: a trial-cache key this machine cannot make, a sign-in take-back that fails, MWM's name of a task's record. - The docs: a command a CLI ran in a session of its own (Claude Code's shell tool) is outside the process group the kill reaches; a `timeout` or an `agent_error` scores 0 when its verifier left no reward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: the post-PR audit of b9a3d61 The post-PR audit of this PR's b9a3d61 found no high or medium issue and four groups of low ones. Each is fixed here; its questions are recorded in the PR. - A `hermit eval` refused at its start (a row of its own reserved key, or a pipeline whose startup checks refuse it: no bubblewrap, a secret in its env) had already emptied the earlier eval's results.jsonl and removed its summary.json: the eval empties them once its pipeline and judge are built, as on `main`, and a refused start leaves them as they were. One that fails after its start still leaves no earlier summary. - `acting_agent.env`'s secrets are read as Harbor fills its values: `${NAME:-default}`, which Harbor fills in from this process's environment, is refused like `${NAME}` (it got through), and a referenced name is a secret's by the rule the variable's own name is (`launch.SECRET_VAR`), so that a setting named like one (`${TOKENIZERS_PARALLELISM}`) is no longer refused. `$NAME`, which Harbor hands on as that text, is still refused where it names a secret, as it never passes the secret the config meant. - `hermit check` refuses a test row's own `repeat` wherever `hermit eval` of the config would (a training config's eval too), by eval's own rule (`_harbor_rows`), and a test now covers it. - Tests: an unused fixture, a temporary directory outside the test's own `tmp_path`, blank lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Rework: Harbor's needs in hermit/harbor, the agent layers as on main Everything in hermit/ outside hermit/harbor/ is back at main (e813538): the three agent layers, the Trainer, hermit eval, hermit check, the configuration, the sandbox, the methods and the hosts, but one change. Pi's and dsh's prepare take serve_tools, as the other four hosts already do, so that a trial gets the adapter's tools from the runner. hermit/harbor/FRAMEWORK_SUPPORT.md lists where each of Harbor's needs now lives, and what could later become framework support. What a Harbor task set now meets: - A trial that is not the agent's result (infra) runs again in the runner (agent.params.infra_retries, 2; infra_wait_s, 300 s). One still infra is refused by the judge, so the run records a failed run (judge_error): hermit eval counts it among its errors and as 0 in its mean. python -m hermit.harbor.report gives pass@1 over the trials that are the agent's result. - A lost sign-in, or an API account's usage limit, raises LoginFailed, which ends hermit train and hermit eval as a local session's does. There is no HALT file. - There is no trial cache; agent.params.trial_cache is refused. - A multi-step task's stream is the runner process's own and is never resumed; a split keeps its steps in order (data.shuffle: false). - A Codex trial's lost sign-in and provider outage are read in hermit/harbor/signin.py (the outage by the session's last failure, so a reconnect Codex recovered from is no outage). - The answer agent's model that only a CLI reaches is given in the benchmark file; a run config's own is refused at startup. - A trial's log keeps the CLI's stream, task.md, prompt.txt, last_message.txt and the hook files at its top, where the methods read a local session's. Fixes of the last audit (of 418a00d): a stream's step gets the sign-in at its turn, not when its rollout began; acting_agent.env secrets are named by Harbor's own rule; each step's allowed hosts reach the driver; the answer agent waits for its plan's window; a long task name's verifier containers are found as Harb CBC5 or names them; a dataset's digest takes a link as the link itself, not the file it points to. Tests of the reverted code are back at main; the Harbor tests cover the new code. Docs and the changelog describe the PR as it is now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: two post-PR audits of the rework The first audit of the rework (2b2a46b) found no high issue, three medium and six low; a second audit of those fixes found no high issue, five medium and ten low. Each is fixed here, in hermit/harbor/, its docs and its tests, or recorded as a candidate where the fix is main's. - An adapter whose own deployment or per-task context fails in its child process is the agent's result: agent_error (adapter_failed), scored 0 with its message as the feedback, which `python -m hermit.harbor.report` counts among the scored trials. It left the pipeline as an exception before (status error), outside pass@1. - A stream's step that ends in any way before its driver is asked for it (its staging, its adapter, its tools, its launch plan, the disk gate, its turn's wait running out, its turn's sign-in or tools not readied, an exception of any of them) gives the stream up, so its driver is stopped once the stream's rollouts end, that step's own when it is the last, and the stream's next pass (an eval's next repeat, a later epoch) starts from its first step in a new environment. Before, the driver stayed up for a step that never came: the next pass's first steps ended stream_order and its last ran on the environment the pass before had left. A step the driver already ran gives nothing up. A later step of a stream with no driver and no rollout of its first step ends before anything is staged or served for it. - A runner's unfinished streams are closed by its finalizer, when the runner is freed and at exit for one still held then. Before, a weak set of runners was closed at exit, and a runner freed before then (`hermit check`'s probe, `hermit eval` once it returned) left its drivers up for stream.idle_s. - The docs say what a resumed `hermit train` does to a stream under way (its remaining steps in that epoch end stream_order, and the stream starts over at its first step's next rollout), and what an Evolver's run_agent of a stream's first step does once the Trainer's pass of it finished: it starts a pass the next epoch inherits. - A request the provider refused for the run's configuration (model_rejected) is not run again (NO_RETRY), and NO_RETRY is tested with runs again allowed; nor is a host failure past the trial's staging (host_failed, whose session may have run), which the docs now say. The `halted` cause, which nothing gives any more, is gone. - Codex: a session the provider refused for the run's configuration or bill (a 400, 402 or 404 Codex does not retry, an API account's quota) is model_rejected, as the other CLIs' are, never the agent's 0. Its usage limit is read from Codex's own notices, never from what its log quotes of the session's work, and a JSON line its log quotes no longer ends the record. A session that failed on its own after a reconnect Codex went on from, or whose response the provider's content filter ended, is no outage. - The answer agent's model a CLI reaches: its sessions run with plan_rerun off, so that a session the plan refused comes back at once (infra, run again once the plan allows) instead of waiting for the window inside the agent's time and scoring as the agent's timeout; its sign-in is checked at startup; its CLI sessions get main's check that the user's own secrets are absent (HOME_SECRETS). The runner refuses a run config's own `{cli}` model for the answer agent as written, as `hermit check` hands it, as well as the endpoint spec `hermit eval` and `hermit train` hand it, whose test builds it with main's endpoint_spec. - The docs say that `hermit check` builds the runner and reports its startup refusals, and that every run of Hermit's agents needs bubblewrap, a baseline's too (the runner cannot tell a run that deploys no adapter), unless sandbox_enforce or HA_ADAPTER_SANDBOX_ENFORCE says best_effort. - The report says when an eval did not finish: no summary.json beside its rows, one that is not of them (its count of trials, of failed runs or its mean score differ), or a last row cut off, which is left out. It reads the summary, never the files' times, which a copy changes. The docs say that a stopped eval writes no row of the repeat it stopped in. - A plan refusal's hold gets the run's stop, so that a hold that cannot be written waits no longer than the run. The docs record that trials racing on one ChatGPT copy for its refresh end the run: the loser's refusal reads as a lost sign-in. - FRAMEWORK_SUPPORT.md names the four private helpers of main that hermit/harbor/ uses, and more candidates: a trial's usage when LoginFailed ends the run, the run's own secrets for the answer agent's sandbox, public names for those helpers, rows that say who runs them (run_agent's or the Trainer's), the `login: claude` check of `hermit train`, RRSI's halt file. The docs no longer say a trial a lost sign-in ended keeps its runs' usage, and bind_agent_params is named right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Review fixes: the tenth post-PR audit The audit of e19d155 found no high issue, two medium and twelve low, and asked eleven questions. Each is fixed here, in hermit/harbor/, its docs and its tests, or recorded as a candidate where the fix is main's. - Pi's and dsh's trials get the backend's developer_role, as Hermit's own sessions do: the spec the config's loading keeps drops it (Binding.spec), so the runner takes the backends registry's for a backend it names at the same URL. A test compares a trial's provider settings with main's bind_agent_params on Fireworks (developer_role: system). - `hermit check` and `hermit train` check a Harbor run's acting model as a chat client's, main's rule for an agent it does not know: they refuse Claude Code on Anthropic's API, which `hermit eval` runs, and do not check that Codex's backend serves the Responses API. The docs say so, and candidate 7 names the cause in main. - On a login, busy_retries is one count over all of a trial's runs: infra_retries no longer multiplies it (up to 12 runs by default, where the docs said 4). A plan refusal of the answer agent's model runs the trial again once the plan allows, not counted in infra_retries. - A staging or per-task-context child that failed is the host's failure (staging_failed, run again), not the adapter's 0, when this process sees this machine fail any adapter's staging there: a folder it cannot write, less than 64 MB free, the strict adapter sandbox not starting. Startup refuses a runner whose bubblewrap cannot start that sandbox. - A trial's launch plan refused for what its adapter is (its tools beside text_only, a dsh server name made of a long id) is adapter_failed, scored 0, for a trial and for a stream's step; with no adapter it is still the config's error. - A provider that does not bill the account (a 402, its quota or credit spent) ends the run, as an API account's usage limit does. Before, every later trial ended model_rejected. - acting_agent.settings.env refuses a secret's $NAME inside a value by every rule (AUTH, PASSWD, Harbor's), and a secret's value written as it is. `effort: off` gives no effort flag, as on main. - The answer agent writes answer.json as a new file renamed into place, never through a link the container left there. Codex's auth.json is removed from the container once it has been copied back, before a verifier that shares the container runs. - The curated log's top stream is the one the launch plan names. The report adds a note when results.jsonl was written after summary.json, as by an eval stopped beside an earlier summary. The runner's finalizer gives each driver 2 minutes (CLOSE_STOP_S) before it kills it. - Tests for each fix above. They also catch four mutations no test caught before: the turn's sign-in copy, the first give-up reason, Codex's outage reading, and the report's errors comparison. - Docs that did not match the code: what `hermit eval` reads of a config made for it alone, the causes never run again, only a first step starting a finished stream over, the CLI Evolvers' run_agent, the stream socket's path, split files with more than one rollout, Harbor's own usage-limit error, when the `login: claude` warning fires, a quoted line in Codex's own form, the relay's sandbox, the deployment record's host paths, and hermit check's probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Rebase onto main: what Hermes Agent is to a Harbor run Main has gained Hermes Agent as a CLI Base Agent (#107, 616e818) since this PR's base, e813538. In the rebase, each conflict keeps both sides: #107's Hermes in the docs' lists and tables of CLIs, and this PR's Harbor beside it. A Harbor trial does not run Hermes: the runner refuses `acting_agent.cli: hermes` at startup, as it refuses any CLI with no HermitXXX class, which a new test holds. The docs now say so (the acting agent's row in docs/framework/task.md, the CHANGELOG entry), and FRAMEWORK_SUPPORT.md counts five other hosts that take `serve_tools`, Hermes's among them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Round-11 audit: a trial's developer_role, a secret's name, which disk gate held The round-11 audit of a332854 found no high or medium issue; these are its low ones and what its questions found. - A Pi or dsh trial's developer_role is the backends registry's only for the backend the registry has at the trial's URL (launch._with_role): the run config's `backends:` is not the runner's to read, where Hermit's own sessions take it. FRAMEWORK_SUPPORT.md (candidate 14), docs/framework/task.md and the changelog said the trial got what Hermit's sessions get; they now say where it does not, and a test holds the URL check, on both of the spec's paths. - acting_agent.settings.env refuses a value given as it is to a variable a word of whose name is a secret's wherever the word stands (HF_TOKEN_READ, OPENAI_API_KEY_2, SECRET_ID), not only at the name's end (launch.SECRET_VAR); a word that only holds one (GIT_AUTHOR_NAME, TOKENIZERS_PARALLELISM) is no secret. A test now holds Harbor's part of the rule for a `$NAME` inside other text ($OAUTH_CLIENT_ID). - The verdict of a trial, or of a stream's first step, that a disk gate held back names the gate that held it, the host's /tmp or Docker's data root; it named the data root whichever held it. - Tests for what none caught: the answer agent's relay's 402 whatever its words, the stop a runner's close gives each driver (CLOSE_STOP_S), a job folder this process cannot write (the host check after a failed staging child). - docs/framework/task.md says what the questions found: a login's wait for its plan has no bound, a request the plan held back at any time makes its timed-out trial infra, a refused session runs again as often as the plan refuses, the host check comes after the staging child, and N hung drivers hold a close up N x 2 minutes. The changelog's Codex refusal no longer reads as every 400 or 404. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Round-12 audit: a stream's next driver, a curated log's links, refusals for good The audit of 6a79375 found one high and four medium issues and fifteen low ones. This fixes the high and medium ones, and fourteen of the low ones (one is in the PR's description); the last is noted there. - High: a stream's next pass (an eval's next repeat) could meet the driver of the pass before in the half second between its last answer and its exit, take it for a live one, and lose the whole pass. The driver's record now says it is ending before its last answers (harborside.driver._mark_ending); StreamClient.running takes neither such a driver nor one killed and not yet reaped, and ensure() waits up to 30 s for an earlier driver to exit, then kills it, before it starts the next. - Medium: a step whose own folder this machine cannot make now gives its stream up (host_failed), so its driver is stopped and the next pass starts anew. Before, the driver waited for that step, and the next pass ran its last step on the old environment. - Medium: a step's curated log walks the agent's folders through open directory handles and opens each entry with O_NOFOLLOW (curate._files, and open_regular for the files at its top). A link that a process the agent left running swaps in while the stream's environment stays up is never followed, and a file gone meanwhile is left out without an error. - Medium: Codex's refusals for good are read in its own words: a provider's error body Codex passes on as it is, "model is not supported", and its plan refusals (a workspace out of credits, a spend cap, a plan without Codex). The plan refusals end the run, as a 402 does. - Medium: the answer agent's relay reads a 429 for a spent quota (OpenAI's insufficient_quota, as its code or its type) as the bill's refusal, which ends the run, not as an outage that runs again. - Low: - A relayed Codex session that main's reader leaves a 502 but whose stream says it was refused for good is a 400 with Codex's words. - The disk gate's verdict names the room for the task's image and for other trials' pulls, and a stream's first step keeps room for its image until its environment is up. - A step waits for its turn over the earlier steps' own budgets. - Refused at startup: a benchmark file's {cli} model without a login, which the runner cannot bind, and a login in acting_agent.settings. - A relative mini-swe-agent settings.config is read beside the params, as the runner's other paths are. - The texts on the line reader, the secret-name rules and their tradeoff, the time a kill takes at exit, the answer agent's effort, and a Harbor Claude session's token (on a descriptor). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Examples: five Harbor benchmarks with baselines and their papers' methods Terminal-Bench 2.0, SWE-bench Verified, AlgoTune, Terminal-Bench-Science and LAB-Bench FigQA through Harbor, each a benchmark file (the registry's task set, locked), a baseline per profile (Codex with GPT-5.6-Luna on a ChatGPT login, Claude Code with Claude Haiku 5.5 on a Claude subscription) and the method whose paper's protocol fits it: the AHE Adapter on Terminal-Bench 2.0 in the AHE paper's in-sample protocol, trained on each task's rollouts #1 and #2 and tested on #3 and #4; its final adapter, frozen, on SWE-bench Verified and Terminal-Bench-Science against AHE's seed; SkillOpt in its paper's protocol on AlgoTune, a trial scored 1 - 1/speedup so that the mean gives AlgoTune's harmonic mean (a success, by which SkillOpt's analysts and slow update sort the rollouts, a solver faster than the reference), and on LAB-Bench FigQA, whose download is patched: the published tasks save the shuffle's seed where the agent reads it, which gives the answer away, and their verifier runs a script the agent can rewrite. LAB-Bench's test questions whose figure no training question has are listed for a second score from the same trials (utils/figures.py reads an eval's results). Every run is the framework's own commands on a config, as on main: a baseline is a config for `hermit eval` alone (`--adapter none`, or an adapter directory: a transfer's, or AHE's seed as the template's directory), whose training keys are placeholders (its Evolver, `eval-only`, one that `hermit train` does not find); a method is `hermit train` and then `hermit eval --adapter final` (and `--adapter root` for its seed or empty skill where no baseline tests it, an adapter of the same run's tree); a whole benchmark's test is an override of the same config (`data.test=../utils/splits/all.txt` with its own run name). An eval's number is the pass@1 that `python -m hermit.harbor.report` gives over the trials that are the agent's result: #105's runner runs an infra trial again, then records a failed run, 0 in `hermit eval`'s mean. AlgoTune's harmonic mean and LAB-Bench's second score read the rows the same way, and say when an eval did not finish. No trial is taken from an earlier run: there is no trial cache. SkillOpt's configs give its analysts no Codex trace summary (it describes SkillOpt's own harness). Every learner on a login waits for the plan's window (`plan_max_wait_s: null`); AHE's learners' clocks count the wait, as on main. examples/README.md says what a machine needs (bubblewrap for every run, a baseline's too) and lists every run with its trials, to be handed out; examples/conftest.py keeps `python -m pytest` out of a prepared task set and a run's `runs/`, and examples/.gitignore keeps the task sets' links out of git; tests/core/test_harbor_examples.py holds the protocols to the committed files (every learner's wait for the plan among them), loads every config as its command does (a baseline's refused by `hermit train`) and builds #105's runner from each config's settings, its startup checks included (this machine's sign-in and bubblewrap stood in for). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP * Dual review: OfficeQA's task builder, keyless backends, a run's spend and stop - build_tasks.py imports task_text from utils/task.py (the module it named is gone) - Claude Code on a backend that needs no key gets its placeholder token - the answer agent's Codex model has web_search off unless given - a row without an instruction gets Harbor's instruction for its context - a benchmark's patch is loaded without writing __pycache__ beside it - a launch's plans folder is the user's only (0700) - curate opens a reward file and hermit-copy/memory without following links - an answer trial whose agent sent no request costs 0, not unknown - a spent quota ends the run even when the agent's time ran out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Haizhong Zheng <hzzheng@umich.edu>
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
This PR is the groundwork for running Harbor's benchmarks with Hermit's methods. After it, a benchmark from Harbor's
registry plugs in as an example folder: a
utils/benchmark.yaml, from whichpython -m hermit.harbor.dataset preparemakes the data and the split files, and configs. The folder's only code, when it needs any, is a patch of the
downloaded tasks (
dataset.patch; LAB-Bench FigQA's removes the shuffle's seed, which gives the answer away). It runsthrough the framework's own commands and configuration, as any task does: a baseline is a config for
hermit evalalone, and a method is
hermit train, thenhermit eval --adapter final. This PR holds no benchmark folder. It coverswhat Terminal-Bench 2.0, SWE-bench Verified, AlgoTune, Terminal-Bench Science and LAB-Bench FigQA need; #106 adds only
their folders. It builds on #56 (Harbor's task format as Hermit's one task protocol, a stream as a multi-step task),
and covers the CLIs
mainadded since: mini-swe-agent (#49), Pi (#89), OpenCode (#94) and the DeepSeek Harness(
dsh, #90) each run in a Harbor trial, as Codex and Claude Code do. Hermes Agent (#107), whichmaingained afterthis PR began, does not: the runner refuses
acting_agent.cli: hermesat startup.Reworked on 11-16: the framework as on
main. The earlier version of this PR changed Hermit's agent layers andthe core around them: how the Base Agents read a CLI's stream, a login and an endpoint; the model layer's bindings;
several methods; the Trainer,
hermit eval,hermit check, the configuration and the sandbox's isolation. All of it isback at
main(now616e818: the PR was rebased onto #107 on 11-17). An integration fits the layers' interfaces rather than changing them(Agent layers: each layer uses the one below it through a single API), as EvoSafe's
does (
examples/agentdyn/evosafe/FRAMEWORK_SUPPORT.md). What a Harbor task set needs now lives inhermit/harbor/, onthe layers' public APIs and four private helpers of
mainthat it names.hermit/harbor/FRAMEWORK_SUPPORT.mdsays where eachneed lives, and lists the candidates for framework support (open for discussion): the fixes and features the earlier
version made in the core, which this one leaves to
main.Outside
hermit/harbor/, docs, tests and the changelog aside: Pi's and dsh'sprepare(hermit/hosts/pi.py,hermit/hosts/dsh.py) takeserve_tools, as Codex's, Claude Code's, mini-swe-agent's, OpenCode's and Hermes Agent's already do, so thata trial gets the adapter's tools from the runner (+5/−3 lines each); and OfficeQA's Harbor example follows HermitCodex:
its judge reads
agent-codex.jsonl(examples/officeqa/utils/harbor/judge.py) andgepa/run_codex_harbor.yamlsetsweb_search. Three choices came with the rework:hermit eval's mean. A trial that is not the agent's result runs again in the runner;one still infra is a failed run, as EvoSafe's judge makes its own:
hermit evalcounts it among itserrorsand as 0in
mean_score.python -m hermit.harbor.report <eval dir>gives pass@1 over the trials that are the agent'sresult, with the infra count beside it.
The ninth commit is the rework, the tenth fixes its two audits' findings, the eleventh the tenth's audit's, the
twelfth says what Hermes Agent is to a Harbor run, the thirteenth fixes the twelfth's audit's findings, and the
fourteenth the thirteenth's; the
eight before them are the earlier version and its review
fixes, so the PR's own diff (
main...harbor-foundation) is the one to read. On 11-17 the eleven commits wererebased onto
main's616e818(#107), each rebuilt as a three-way merge of its tree withmain's, every conflictkeeping both sides, and their authors, dates and messages kept; their ids changed (
2b2a46bis now5c3984c,e19d155e51fbb6,f9b6a14394cd0f), and the audits below name the ids they read. The rework also fixes theearlier version's last audit's findings in
hermit/harbor/(of418a00d: one medium, six low). Part 3 has both.The decisions it implements:
task's container. A Harbor trial is then one more session of that CLI: the same home, command and stream as Hermit's
own sessions, and its outcome read back by the same Base Agent. The answer agent (
cli: answer) makes its one modelcall from Harbor's process; Harbor's own agents run as Harbor installs them.
prepare, which names no tool server; the adapter's tools are served fromthis machine, on the Docker bridge's gateway, to the session in the container.
there (mode 600), removed once it has been copied back; the refresh it hands back becomes the shared copy only after
Hermit's checks.
then is a failed run (above). An adapter whose own deployment fails is the agent's 0, unless this machine is seen
to fail any adapter's staging (no room, no working sandbox).
Harbor's own job mean does. A trial Harbor grades is graded as Harbor grades it: a verifier that left no reward or
ran out of its time, and a request one of Harbor's own agents made that the provider refused for what it held, are
the agent's 0, unless Hermit's own checks show the host failed (the verifier's tools never arrived, the disk full
before its tests wrote a report). A provider that could not serve stays infra.
quota, a Codex plan that refuses every session until someone acts), ends the run
(
LoginFailed), as it ends a run of Hermit's own sessions:hermit trainresumes after its last finished step.hermit trainandhermit evalon a config, with overrides, as before.1.
hermit/harbor/runner.pyHarborAgent, the pipeline ofagent.name: harbor: one Harbor trial per row (or one step of a stream), the checks before the first trial, the sign-in's plan, the infra retries (infra_retries, 2;infra_wait_s, 300 s), the verdict,LoginFailedlaunch.pystaging.py,context.pyprepare(serve_tools=False)in the strict adapter sandbox, and a per-task context computed theretools.pyAdapterTools); the answer agent's model endpoint (ModelEndpoint), which serves a model only a CLI reaches itself, waiting for its login's plan, a session the plan refused returned at oncesignin.pycurate.pyjudge.py,report.pyUnscored); an eval's pass@1 over the scored trialsdataset.pypython -m hermit.harbor.dataset prepare: a benchmark's tasks, rows, splits, smoke rows and lockdocker.py,errors.py,stream.py,clis.pyharborside/hermit.py), the answer agent, the scripted agent for smokes, the stream driverWhat it costs to stay on
main's interfaces is inFRAMEWORK_SUPPORT.md; the main points:hermit checkknows noHarbor setting itself, but it builds the runner, so it reports the runner's startup refusals; it and
hermit traincheck a Harbor run's acting model as a chat client's, so they refuse Claude Code on Anthropic's API, which
hermit evalruns (candidate 7); an eval-only config gives
data.train,templateandevolver.name, whichhermit evalreads(its folder is named from the evolver and the template); a stream is the runner process's own, never resumed, and a split keeps its
steps in order (
data.shuffle: false); the answer agent's model that only a CLI reaches is given in the benchmarkfile, since the pipeline would serve a run config's own and wait for its plan inside the request, which the runner
cannot tell from the model's own time.
2. The two hosts
hermit/hosts/pi.pyandhermit/hosts/dsh.py:prepare(..., serve_tools=True). False writes no server for theadapter's tools into
.pi/mcp.jsonor dsh's patch layer, for a caller that serves them itself. Tested beside the otherhosts'
serve_tools(tests/core/test_deploy.py).3. The audits' findings, fixed
The thirteenth commit's audit (of
6a79375) found one high and four medium issues and fifteen low ones. Thefourteenth commit fixes all of them but one low one, noted below. The high and medium ones meet a path that none of
#106's five benchmarks takes today (none has a multi-step task), or a refusal's wording:
half second between its last answer and its exit, take it for a live one, and lose the whole pass (
stream_order).The driver's record now says it is ending before its last answers (
harborside.driver._mark_ending).StreamClient.runningtakes neither such a driver nor one killed and not yet reaped.ensurewaits up to 30 s foran earlier driver to exit, then kills it, before it starts the next.
host_failedoutside what gives a stream up. Itsdriver waited for it, the next pass's first step met that driver (
stream_order), and its last step ran on the oldenvironment, scored as the agent's. It now gives its stream up.
(a stream's environment stays up between steps) could swap a link in meanwhile, and a file of this machine would be
copied into the log. The walk now holds each folder open and opens each entry through it with
O_NOFOLLOW(
curate._files;open_regularfor the files at the log's top). A file gone meanwhile is left out, not an error.body it passes on as it is (
{"error": ...},{"detail": "... model is not supported ..."}), and its planrefusals (a workspace out of credits, a spend cap, a ChatGPT plan without Codex). The first are
model_rejectednow. The plan refusals end the run, as a 402 does.
insufficient_quota) as anoutage, and ran the trial again and again. It is the bill's refusal now (its code, its type alone, or a CLI's words
for it), which ends the run.
main's reader leaves a 502, but whose stream says it was refused for good, is a 400with Codex's words: the run's configuration, its bill, or the agent's result for a prompt too long.
keeps room for its image until its environment is up.
{cli}model without a login (the runner cannot bind its reference), anda
logininacting_agent.settings.settings.configis read beside the params, as the runner's other paths are.main's), the secret-name rules and their tradeoff, the timea kill takes at exit, the answer agent's effort (sent with each request: one its model does not take is each
trial's
model_rejected), a Codex retry that names no failure, a Harbor Claude session's token (on adescriptor; the container is its boundary,
docs/framework/task.md), and this description's Cancellation line(Review).
the session's own failure after the retry, and Codex's text for a Cloudflare block meets neither the lost sign-in
nor the outage rule. Both were met only in made-up streams. A rule waits for a real stream to read.
plan_max_wait_sfor a CLI-reached answer model), a request the plan held back briefly, an aborted stream's remaining steps (infra,
not Harbor's own final strategy), a lasting 403 read as a lost sign-in, and a session that drew usage credits
(
main's rule: the plan held until its window resets).The twelfth commit's audit (of
a332854, the rebased head) found no high or medium issue and three low ones,all fixed in the thirteenth commit:
developer_roleis the backends registry's (the built-ins and the user's backendsfile), never the run config's
backends:, which the runner does not read and Hermit's own sessions do: a rolethe config sets, or a backend it declares or moves to another URL, gives the trial other provider settings than
Hermit's session, though FRAMEWORK_SUPPORT.md said they were the same. Candidate 14, the trial's paragraph in
docs/framework/task.mdand the changelog now say where they differ, and a test holds the same-URL check.acting_agent.settings.envrefused a secret's value written as it is only when the variable's name endedlike a secret's (
HF_TOKEN_READ,OPENAI_API_KEY_2,SECRET_IDwent into the plan), though the docs said anysecret's name. Any word of the name counts now (
GIT_AUTHOR_NAME,TOKENIZERS_PARALLELISMare still none),and a test holds Harbor's part of the rule for a
$NAMEinside other text ($OAUTH_CLIENT_ID).the stop a runner's close gives each driver (
CLOSE_STOP_S), the host check's folder this process cannotwrite, and the two above. Each now fails a test when undone.
docs/framework/task.md: a login's wait for its plan has no bound (a Harbor runhas no
plan_max_wait_s), a request the plan held back at any time makes its timed-out trial infra, a refusedsession runs again as often as the plan refuses, the host check comes after the staging child (so an adapter
that fills the disk reads as the host's failure), and N hung drivers hold a close up N × 2 minutes. Examples: five Harbor benchmarks with baselines and their papers' methods #106's
audit of the same head found a trial the host's /tmp held back recorded as held by Docker's data root: the
verdict now names the gate that held it.
The rebase onto
main's616e818(11-17; #107, Hermes Agent as a CLI Base Agent). The final tree's conflictswere four docs files, each merged with both sides:
configuration.md'sagent.namerow andcompatibility.md'sline on per-task context name
hermesbesideharbor,model-backends.mdhas #107's Hermes row and this PR'sHarbor row, and
task.md's opening of the CLI agents nameshermesamong the CLIs that act in a workspace ofHermit's. In the earlier version's commits a few code files conflicted too (
trajectory.py,workspace.py, the AHEDebugger's stream texts,
tests/selection.py), each with both sides kept, which the ninth commit reverts tomain's, now616e818's. The twelfth commit: a Harbor trial does not run Hermes Agent, and the runner refusesacting_agent.cli: hermesat startup, as it refuses any CLI with no HermitXXX class (a new test); the acting agent'srow and the changelog say 8000 so, and FRAMEWORK_SUPPORT.md counts five other hosts with
serve_tools. What #107 changedin
main's code thathermit/harbor/calls is Hermes's alone (its CLI kind, login rule, record and stream readers,deployment), but for one change to
main's own sessions: their usage is summed over a session's usages, as Hermesreports its auxiliary calls apart. A trial's usage is its stream's one, as every CLI a trial runs reports one.
The tenth commit's audit (of
e19d155) found no high issue, two medium and twelve low, all fixed in the eleventhcommit:
developer_role(main'sBinding.specdrops it), so onFireworks (
developer_role: system) they lacked the provider setting Hermit's own sessions get. The runner now takesthe backends registry's for a backend it names, and a test compares a trial's settings with
main'sbind_agent_params.hermit checkandhermit traincheck a Harbor run's acting model as a chat client's (main's_cli_kindnames no CLI for
agent.name: harbor): they refuse Claude Code on Anthropic's API, whichhermit evalruns, and donot check that Codex's backend serves the Responses API. The fix is
main's: the docs say so, and candidate 7 namesthe cause.
busy_retriesis one count over all of a trial's runs (infra_retriesmultiplied it: up to 12 runsby default, where the docs said 4); a plan refusal of the answer agent's model runs the trial again once the plan
allows, not counted in
infra_retries; a staging or per-task-context child that failed while this machine fails anyadapter's staging (a folder it cannot write, under 64 MB free, a sandbox that does not start) is infra, not the
adapter's 0, and startup refuses a bubblewrap that cannot start the sandbox; a trial's launch plan refused for what
its adapter is (dsh's server name made of a long id, tools beside
text_only) isadapter_failed, not a pipelineerror;
acting_agent.settings.envrefuses a secret's$NAMEinside a value by every rule, and a secret's valuewritten as it is;
effort: offgives no effort flag, as onmain;answer.jsonis written as a new file renamedinto place, never through a link the container left; the curated log's top stream is the one the plan names; the
report notes rows written after their summary (an eval stopped beside the summary of the one before, which its
content can match); a line in Codex's own form that the session's work printed reads as Codex's, which the docs now
say (rare); four mutations no test caught are caught now; and the docs that did not match the code are fixed (what
hermit evalreads of an eval-only config, the causes never run again, only a first step starting a finished streamover, the CLI Evolvers'
run_agent, the socket's path, split files with more rollouts, Harbor's own usage-limiterror, when the
login: claudewarning fires,read_steps).as an API account's usage limit does, where every later trial was
model_rejected; Codex'sauth.jsonis removedfrom the container once copied back; the finalizer gives each driver 2 minutes before it kills it; the docs say that
hermit check's probe runs a real trial, that the relay's sandbox followssandbox_enforce(notHA_ADAPTER_SANDBOX_ENFORCE), that the deployment record names this machine's paths, and that a$NAMEinside asettings.envvalue is this machine's value.main's_no_replyreads an outage before a plan refusal: candidate 12.The rework's second audit (of the tenth commit as first written, before this push) found no high issue, five
medium and ten low, all fixed in the tenth commit now:
could not be readied at its turn, or whose launch raised (a ValueError) still left the driver up, and the next pass
scored a step that ran on the earlier pass's environment. Every end before the driver is asked for the step now
gives the stream up; a step the driver already ran gives nothing up.
hermit check's probe and a finishedhermit evalleft them up forstream.idle_s. Each runner's finalizer nowcloses its streams when it is freed, and at exit for one still held then.
main'splan_rerun), and the trial scored as the agent's timeout. Its sessions now run withplan_rerun: false: therefusal comes back at once, infra, and the trial runs again once the plan allows.
run_agentof a stream's first step, once the Trainer's pass finished, starts a pass the nextepoch inherits. The runner cannot tell
run_agent's rollout from the Trainer's: the compatibility page and themethods' pages say so, and candidate 3 now asks for rows that say who runs them.
refusal is now
model_rejected, as the other CLIs' are: infra, never run again, the run going on.log quotes no longer ends the record, and a session that failed on its own after a reconnect it went on from, or
whose response a content filter ended, is no outage; the report reads a cut-off last row as an unfinished eval; the
answer model's CLI sign-in is checked at startup; a refusal's hold gets the run's stop; the docs name
model_rejectedandhost_failedamong the causes never run again, say that a stopped eval writes no row of therepeat it stopped in, and that Harbor's own agents skip the bubblewrap check (
HA_ADAPTER_SANDBOX_ENFORCElifts ittoo); stale texts are fixed (the module's example config,
verifier_timeout_verdict, Harbor's own agents' stopmessage, the changelog on a stream's slots and on
stage()). Plausible, documented: trials racing on one ChatGPTcopy for its refresh end the run, a loser's refusal read as a lost sign-in (the winner's copy then serves the
resume).
main's own: RRSI'shalt_fileandhermit train'slogin: claudecheck, candidates 16 and 7.The rework's audit (of
2b2a46b) found no high issue, three medium and six low, all fixed in the tenth commit:exception (
status: error), which the report counted as a failed run, outside pass@1, though the docs called it theagent's 0. It is now the agent's result:
agent_error(adapter_failed), scored 0 with its message as thefeedback, counted in pass@1.
this machine) left the driver up, waiting for it, so the stream's next pass in the same runner (an eval's next
repeat, a later epoch) ended its first steps
stream_orderand ran its last on the environment the pass before hadleft. Every step that ends before the driver now gives its stream up: the driver is stopped when the stream's
rollouts end, and the next pass starts from step 1 in a new environment. A later step of a stream with no driver
ends before anything is staged for it.
hermit trainstarts its streams over. A stream under way loses its remaining stepsin that epoch (
stream_order, a new runner has no driver for it) and starts over at its first step's next rollout;the docs now say so (continuing it needs a run identity in
main: candidate 4).model_rejected) is no longer run again, andNO_RETRYis tested with runs again allowed;hermit checkbuilds the runner, so it reports its startup refusals(the docs and this description said it saw none), and the runner now refuses a run config's own
{cli}answer modelas
hermit checkhands it too; the docs no longer say that a trial a lost sign-in ended keeps its runs' usage(candidate 18); the answer agent's CLI sessions get
main's check that the user's own secrets are absent(
HOME_SECRETS; the run's own secret paths need the config: candidate 19);PIPELINE_CLI_SPEC's test builds itsspec with
main'sendpoint_spec, andFRAMEWORK_SUPPORT.mdnames the four private helpers (candidate 20); stalenames (
bind_harbor_params, thehaltedcause) are gone.said only a run that deploys adapters), and the report says when an eval did not finish (a lost sign-in leaves the
summary of the eval before beside rows without the repeat it stopped in).
The earlier version's last audit (of
418a00d) found no high issue, one medium and ten low. The medium one: a stream's step onlogin: chatgptwas given the sign-in when its rollout began, not at its turn, so an earlier step's refresh could leave it aused one; it is now handed in at the step's turn (
launch.render(sign_in="later")). The low ones inhermit/harbor/:acting_agent.envsecrets are now named by Harbor's own rule (KEY|SECRET|TOKEN(?!S)|PASSWORD|CREDENTIAL|AUTH), andthe docs say what Harbor fills in (a whole
${NAME}or${NAME:-default}); each step's allowed hosts reach thedriver; the answer agent waits for its plan's window on a refusal; a long task name's verifier containers are found as
Harbor names them; a dataset's digest takes a link as the link itself. The other four were in files that are back at
main.For an existing Harbor config
HermitCodex is the default acting agent, in place of Harbor's own Codex. Codex on the ChatGPT sign-in is
login: chatgptwith the CLI's model name (codex_loginis gone), and Harbor's owncodexandclaude-codeare given nosign-in of the user's (the subscription runs with
cli: claudeandlogin: claude). A trial of a CLI of Hermit's tableneeds
web_searchset (OfficeQA'sgepa/run_codex_harbor.yamlsets it), and one that passes a key runs only onHarbor's local Docker environment.
verifier_timeoutdefaults toagent, and a verifier that left no reward Harborcould read is the agent's 0. An OfficeQA Harbor task set built before needs building again (its judge reads
HermitCodex's
agent-codex.jsonl), and a dataset lock written before needs writing again when a task file's mode wasother than 644 or 755 or a task holds a link.
Documentation
Benchmarks has the whole of it: the benchmark file,
dataset prepare, the actingagents and their settings, the sign-in, the verdicts, streams and the startup refusals. Also changed: the evaluation
guide (a Harbor eval's repeats, its infra trials,
hermit.harbor.report, a lost sign-in and the eval it stopped),docs/reference/compatibility.md(a known limitation: a method that runs a stream's training steps throughrun_agent), troubleshooting, the Claude subscription guide, model backends, installation (mini-swe-agent's packagefor a Harbor run), the methods pages where a Harbor trial differs, the OfficeQA recipe,
examples/README.mdand thechangelog.
Validation
On this PR's head
849f5a2, onmainat616e818. Linux x86_64 (RHEL 9) as a non-root user, Python 3.12.13, avenv with
.[test], mini-swe-agent 2.4.6 (themini-swe-agentextra) and thegepa,skillopt,harness2andrrsidependency groups (notace's sentence-transformers).tests/and the examples' own tests, 70 files), aspython -m pytestcollects it, in 8 parallelshards of its files (each its own
pytestprocess and temporary directory): 1815 passed, 99 skipped, 4 failed.mainat616e818, the same way: 1526 passed, 99 skipped and the same 4 failed.tests/core/test_sandbox.py::test_a_linked_venv_runs_by_its_own_name_with_its_own_packages, and three tests inexamples/clbench_database/utils/tests/test_parity_golden.py, which compare against a local MetaWorld checkout.main's: missing dependencies, CLIs and opt-ins (--integration, a Docker opt-in, the Harborsmoke, run below).
test_harbor_runner.py167 passed,test_harbor_harborside.py67,test_harbor_dataset.py43,
test_harbor_launch.py26,test_deploy.py43 (the two hosts'serve_toolswith the others'), OfficeQA'sHarbor judge 8. Each of the eleventh, thirteenth and fourteenth commits' fixes undone in turn (19, 9 and 23
mutations) fails a test.
tests/core/test_harbor_smoke.pywithHERMIT_HARBOR_SMOKE=1, on this machine's Docker (Harbor 0.25.0): 2 passed,a single-step trial and a three-step stream, with the scripted agent and no model (the runner's startup check of the
strict adapter sandbox, the curated log's copy of the agent's top files, and the stream driver's record of its end
among what ran for real; the walk of the agent's hook and memory folders, which the scripted agent leaves empty,
is its tests').
docs/build.sh, Sphinx with-W) succeeds, andpre-commit run --all-filespasses.hermit/harbor/and its tests aref9b6a14's (the twelfth to fourteenth commits' changes aside); outsidethem the tree differs from
mainonly in the two hosts, the docs and the changelog; andmain's change frome813538is the same in every file but the eight both changed, whose merged lines part 3 gives (git range-diffshows commits 7, 8 and 10 unchanged, the others changed only where they met Add Hermes Agent as a CLI Base Agent (acting agent and hermes Evolver) #107).
d8496e4, its five benchmark folders on this head:a5ca0d4's change before the rebase, withits round-11 and round-12 audits' text fixes):
the whole suite, the same way (74 files), 1924 passed, 99 skipped and the same 4 failed;
hermit check --no-probeonits 26 configs reports only what Examples: five Harbor benchmarks with baselines and their papers' methods #106 lists; LAB-Bench FigQA's SkillOpt smoke in real containers,
hermit trainandthen
hermit eval --adapter finalwith Codex 0.169.0 on the ChatGPT login: 18 trials, each with the verifier'sreward, none infra or a failed run (Examples: five Harbor benchmarks with baselines and their papers' methods #106's Validation). It ran on the head before the tenth commit (
2b2a46b, Examples: five Harbor benchmarks with baselines and their papers' methods #106'scc9759f). The tenth commit's changes are on no path its trials took (Codex trials whose sessions were all served,where the tenth commit's readings are of unserved ones; no adapter failure, no stream, no infra trial, no answer
agent), nor is Add Hermes Agent as a CLI Base Agent (acting agent and hermes Evolver) #107's (Hermes Agent beside the code they ran), nor the thirteenth commit's (the rule for
settings.envnames, which the config sets none of; a disk verdict's text; Pi's and dsh's role). Four of theeleventh and fourteenth commits' are: the startup check that the strict adapter sandbox starts (the Docker smoke
above runs it for real), the removal of
auth.jsonfrom the container after its copy-back (harborside's tests,under Harbor's interpreter), the log's top stream taken from the plan (the same
agent-codex.jsonl), and the copiesof a trial's agent files into its curated log (its tests; the Docker smoke above runs the copy of a log's top files
for real).
Its eval, read again with this head's report, gives the same figures and reads as finished. The secret scan of
those runs, of both PRs' diffs, commit messages and descriptions found none of the two Claude tokens or the ChatGPT
sign-in's tokens.
d8496e4(14m7s).Review
Tests and documentation cover the affected behavior, where applicable.
mainaremain's again (tests/core/test_trajectory.pyandtest_harbor_core.py, which tested the earlier version's core changes, are gone). The Harbor tests cover thereworked code: the stream read back through the Base Agent, Codex's lost sign-in and outage (
signin.py), thesign-in handed back, the infra retries (
NO_RETRYwith runs again allowed) and the judge's refusal, the report (anunfinished eval among it),
LoginFailedthrough the rollouts ofhermit trainandhermit eval(run_tasks), the relay's plan waits and a lost sign-in behind it, the startuprefusals, the curated log read by
main's trajectory readers, the host deployments in their child process (Pi anddsh with tools), and the audits' fixes (the adapter's own failure scored and reported, a stream given up by every
end before its driver, a freed runner's drivers stopped, the run config's
{cli}answer model ashermit checkhands it, the relay's
plan_rerun: false, Codex's refusals of a configuration or a bill, its usage limit andoutages from its own notices, a cut-off row in the report), and the eleventh commit's (Pi's and dsh's provider
settings against
main'sbind_agent_params,busy_retriesas one count, the relay's plan refusal not counted,the staging's host checks and the startup sandbox check, a launch plan refused for its adapter, a bill refused,
settings.env's secrets,effort: off,answer.jsonthrough a planted link,auth.jsonremoved, the plan's topstream, the report's note, and the four mutations no test caught), and the fourteenth commit's (a stream's
next driver, a step's folder not made, a link swapped in while a log is curated, Codex's plan refusals and
error bodies, a spent quota's 429, a relayed Codex refusal, the disk verdict and a stream's image room, the
turn's wait, the refused
{cli}model and settings login, mini-swe-agent's relative config). Their cost onthis machine:
test_harbor_runner 8000 .pyabout 115 s,test_harbor_harborside.py25 s,test_deploy.py21 s, the others about asecond each.
Commands, defaults, and public interfaces are consistent.
python -m hermit.harbor.dataset prepareand a benchmark file'sdataset:block;python -m hermit.harbor.report; the Harbor agent'sacting_agent.clifor each CLI, and its sign-in, network, judge, infraretry and disk-gate settings (
docs/framework/task.md#benchmarks); the two hosts'serve_tools.agent.params.trial_cache, a benchmark file's<backend>/<model>model, Harbor's retry onlogin: chatgpt, an answer agent's model a CLI reaches given in the run config, or one on a login with no sign-inthere, a bubblewrap that cannot start the strict adapter sandbox, and a secret's
$NAMEinside a value ofacting_agent.settings.envor a secret's value written there.hermit checkreports them too,as it builds the runner.
hermit trainandhermit eval --adapter ...as onmain.Shared logs and examples contain no credentials or private data.
Documentation-only: links the issue where it was discussed with the core team. (Not a documentation-only PR.)
Core changes: none but the two hosts'
serve_tools(part 2). What could become framework support is listed,for discussion, in
hermit/harbor/FRAMEWORK_SUPPORT.md.Implementation correctness and failures:
it, by the verifier's reward (0 without one); an adapter whose own deployment or per-task context fails is the
agent's 0 (
adapter_failed). Infra (a host or Docker failure, this machine's failure while the adapter is staged,a launch that failed, a session that never started, a provider that could not serve) runs again in the runner,
then is a failed run. A request the provider refused for the run's configuration (
model_rejected, Codex'sincluded) and a disk gate that waited its time out are infra not run again (
NO_RETRY), as are a host failurepast the trial's staging (
host_failed, whose session may have run) and a task Harbor runs for none of Hermit'sagents, never started (
unsupported_task). A staging child that failed while this machine fails any adapter'sstaging (no room, a folder it cannot write, a sandbox that does not start) is infra, not the adapter's 0.
LoginFailed): Codex's read from its stream (signin.codex_signin_lost), ClaudeCode's by its Base Agent, a CLI-reached answer model's by the relay. So do an API account's usage limit and a
provider that does not bill the account. Rollouts waiting for the plan or a retry end
with it, and no container starts after it.
after a session still run; a copy that failed is dropped, never kept in part; a request still in flight when its
trial ends is given up; a stream step whose turn cannot come ends at once (
stream_order), starting no driver(before anything is staged for it when the stream has no driver); a step that ends in any way before its driver
is asked for it (its own folder not made among them) gives its stream up, whose driver is then stopped, so that
the stream's next pass starts anew, its driver once the earlier one has exited; a runner's unfinished streams are closed when it is freed
and at exit; a stream driver that answers no stop is killed with its process group.
docs/framework/task.md#benchmarks).Real execution paths and tests:
hermit evaland Harbor.main's Base Agents.Test checklist:
tests/core/(test_harbor_runner.py,test_harbor_harborside.py,test_harbor_dataset.py,test_harbor_launch.py,test_harbor_smoke.py); the hosts' intest_deploy.py; theOfficeQA Harbor judge's are the example's own (
examples/officeqa/utils/tests/test_harbor_judge.py).tmp_path, use no sign-in, token or network, and start no container unlessHERMIT_HARBOR_SMOKE=1(run in Validation).Sandbox checklist:
hermit/isolate.py,hermit/sandbox.pyandhermit/sandbox_relay.pyaremain's.That container is the boundary Harbor's tasks define, so the session does not go through
hermit.sandbox.(
hermit.harbor.staging,.tools,.context): never in the runner's process, nor with its keys or network.model: {cli: ...}in the benchmark file): its sessions run on thismachine in
main'scli_sandbox(roleagent-model), withmain's check that the user's own secrets are absent(
HOME_SECRETS). The run's own secret paths (run_secrets) need the config, which the runner never gets(
FRAMEWORK_SUPPORT.md, candidate 19).harbor runruns as a subprocess in Harbor's own venv, unconfined, as onmainsince Benchmarks: one task protocol (Harbor's format) for single tasks and streams #56. It drives Docker.main's.This description: read end to end against the code and the run records above.
Independent review (post-PR audit): of this head
849f5a2: no high or medium issue. An agent that did notwrite the PR (Opus 5.5, at max effort) audits each head against the general, test and sandbox checklists. Its
eight low findings are not fixed in this head:
sandbox_enforcevalue other thanrequiredorbest_effort(a typo) is not refused at startup: eachadapter trial then fails in its staging child, scored as the adapter's 0;
{cli: codex}model withoutweb_searchpasses startup, and then every trial ismodel_rejected, thoughdocs/framework/task.mdsays the answer agent needs noweb_search;the trial's run (a failed run, no log), where
os.walkcopied it;_turn_wait, the quota code inconfig_refusedandbilling_refused, the task given to_disk_heldat its two calls);new refusals), the turn wait's default, a stream step's plan holds for a CLI-reached answer model, the stream
socket's place (
XDG_RUNTIME_DIR, a cache folder or/tmp),check_env's rule (Harbor's andSECRET_VAR's), and a kill'sdocker compose downtime;--basetemp(or macOS's) puts past thepath limit;
RuntimeErrorof a trial's launch render (a sign-in gone after startup, a plan check) is a failedrun, not run again, where a stream step's is
staging_failed.Its questions: the driver's
endingwritten after its teardown, a reused pid beside a killed driver's socket, therelayed refusal's message joined on one line, a plan refusal after a reconnect notice (
main's 503), image roomheld by every stream step that finds no driver, a halting trial's plan report, and Codex's "model is not
supported" wording, which the server writes (not in the 0.164 binary).
The thirteenth commit's audit (of
6a79375) found one high and four medium issues and fifteenlow ones, all but one low one fixed in the fourteenth commit (part 3). The twelfth commit's audit (of
a332854) found no high or medium issue; its three low ones are fixed in the thirteenth commit (part 3). The tenth commit's audit (ofe19d155) found no high issue; its two medium and twelve low ones arefixed in the eleventh commit (part 3). The rework's two audits (of
2b2a46b, and of the tenth commit as first written) found no high issue;their three and five medium and six and ten low ones are fixed in the tenth commit (part 3). The earlier version's seven audits (of
a0f4fa8,2d9401c,fe8c5b4,3a49adc,e7ace26,b9a3d61and418a00d) found, in all, one high and thirteen medium issues (and Examples: five Harbor benchmarks with baselines and their papers' methods #106's audits three more in thisPR's code), each fixed in its commit. The rework keeps the fixes that are in
hermit/harbor/; the others went backto
mainwith their code, andFRAMEWORK_SUPPORT.mdlists as candidates those that fixedmain's own behavior.🤖 Generated with Claude Code
https://claude.ai/code/session_01FcJCJanVqQuJyChDevJNYP