8000 Refactor: fixes from the final review (verifier script's own environment, host faults, usage) by haizhongzheng · Pull Request #116 · Infini-AI-Lab/hermit · GitHub
[go: up one dir, main page]

Skip to content

Refactor: fixes from the final review (verifier script's own environment, host faults, usage) - #116

Merged
haizhongzheng merged 3 commits into
task-environment-refactorfrom
task-env/final-fixes
Nov 20, 2026
Merged

haizhongzheng merged 3 commits into
task-environment-refactorfrom
task-env/final-fixes

Conversation

@haizhongzheng
@haizhongzheng haizhongzheng commented Nov 20, 2026 •
Copy link
Copy Markdown
Member

Change

Fixes from the final review of the whole refactor (the integration branch task-environment-refactor against main,
Codex gpt-6.2-sol), before the branch goes to main. Into task-environment-refactor.

  • Security (P1, from Refactor 2/4: task directories in Harbor's format, their own verifier, the bwrap backend; OfficeQA as task directories #113): a task's own verifier script (judge: hermit.task.verify:script, shared or separate)
    inherited the acting agent's sandbox environment, so tests/test.sh could read the agent model's API key and reach
    its provider. Its sandbox is now built only from the task's environment (environment.read/write/env/network/ allowed_hosts, with a proxy for those hosts only); the model's key, provider hosts, forwarded ports, the login's plan
    and the CLI's install stay out. A trusted judge.py keeps the agent sandbox's copy, as on main.
  • Results and cost: a host sandbox failure is infra (staging_failed, run again), not a scored adapter failure (the
    old runner's sandbox_fault preflight, ported); usage in an answer agent's HTTP error body is counted; an unreported
    CLI token count stays unknown, not 0; a data.view that changes a task's id is refused; an unreadable optional
    feedback.txt keeps the reward; AgentDyn/AgentDojo snapshots copy data.view like their other entry points.
  • Docs: the sandbox role table for Harbor runs. Minor: RRSI's score module loaded once; a dead test fixture.
  • Review rounds' edges: bwrap missing refused at preflight (as main); staging failures on this machine (the strict
    sandbox not starting, ENOSPC) are staging_failed infra, retried, cost kept; a terminal error after a retry keeps
    every attempt's spend; data.view gets a deep copy of the row; the script verifier's sandbox keeps hide=[] like a
    trusted judge (key, model hosts and ports still out); billed HTTP-error usage counted outside Harbor too; all-zero
    usage in an error body counts as no report; module-form data.view refused in snapshots.
  • Left as known issues (the old runner behaved the same): a ChatGPT refresh lost on Harbor's hard timeout; the report
    reading output.status; a billed quota refusal that stops the run is not counted in its spend
    (fe4c071f:hermit/harbor/runner.py:1745-1747).

Validation

  • Full pytest --changed --base origin/main in a clean worktree on the final head 25daedcb: 1932 passed, 118
    skipped, 0 failed. CI: pass. (Under two parallel full suites, two reharness tests once saw retrieved reflections in
    reversed order; the test and its code are unchanged since main, and alone they pass.) Earlier: the real Docker + Harbor test and the Debian kill_groups test pass. Each fix has a test that fails without
    it (the P1's under real bubblewrap, shared and separate: the agent sees the key, the script neither the key nor a
    proxy).
  • Terminal-Bench smoke (mounted Codex, GLM 5.3 Flash): 1.0, no errors, no key in any output, no leftover containers.

Review

  • Independent review (this session and Codex gpt-6.2-sol, 2 rounds, the user's triage standard): round 1 found 8
    P2/P3 edges of the fixes (all fixed), round 2 found 5 (no P1; 4 fixed, 1 out of scope as the old runner's).
  • Tests and documentation cover the affected behavior.
  • Shared logs and examples contain no credentials or private data.

🤖 Generated with Claude Code

haizhongzheng and others added 3 commits November 20, 2026 03:22
…sage

- A task's own verifier script (hermit.task.verify:script, shared or
  separate) runs in a sandbox built from the task's environment only: never
  the acting model's key variable, provider hosts or forwarded ports.
- The strict adapter sandbox is preflighted at startup for a Harbor task set
  (the runner's sandbox_fault), and a deployment or context that fails because
  it stopped starting is staging_failed (infra, run again), not a scored 0.
- The answer agent counts the usage an HTTP error response reports, on the
  scored result and on the infra end.
- A ledger of only unreported sessions or calls has unknown tokens, not 0.
- data.view must keep each task's id.
- An unreadable optional feedback.txt leaves the verifier's reward.
- AgentDyn/AgentDojo snapshots freeze data.view like the agent and judge.
- Docs: Hermit's Harbor judge on the host; the verifier script's sandbox.
- Minor: the RRSI trials judge loads its score module once; a dead fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- sandbox_fault: bubblewrap missing under a required sandbox is a fault (the
  runner refused it at startup), at startup and at run time.
- The answer agent's session construction (its context tool's server) is
  inside the guard: a sandbox that stopped starting there is infra too.
- A staging failure on this machine (the strict sandbox not starting, an
  OSError such as a full disk) is an infra output, staging_failed: run again,
  nothing spent, so a later passing run keeps a known cost.
- data.view reads a copy of the row: a view that rewrites its input cannot
  change the task or merge two tasks.
- The verifier script's sandbox does not apply sandbox.hide (the agent's), as
  a trusted judge's never did; the model key, hosts and ports stay out.
- What a failed call billed (its error's usage) is counted on the failed
  record outside Harbor too, across the task sandbox's worker.
- Snapshots refuse a module-form data.view (read live where it is installed).
- Docs: the verifier script's boundary stated as the grants it lacks.
- Minor: the RRSI judge loads under a lock; the 503 test asserts its attempts
  and their combined cost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A CLI agent's staging folders that cannot be made (a full disk) in a task's
  own environment are staging_failed (run again, nothing spent), as the
  runner guarded its job's folders with the staging; an answer agent whose
  context server's files cannot be made (OSError) is staging_failed too.
- A pipeline's own failure after an infra run again sums every attempt's
  spend through Attempts, the failed one's included when it said.
- An error body's all-zero usage (a session's placeholder) is no report, as
  hermit.tools.failed_usage reads it.
- Docs: a shared judge's verifier script runs in a sandbox of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@haizhongzheng
haizhongzheng merged commit 22e97d7 into task-environment-refactor Nov 20, 2026
1 check passed
haizhongzheng added a commit that referenced this pull request Nov 20, 2026
Task/environment refactor: task directories, Harbor as environments, every agent Hermit's (#112-#116)
@haizhongzheng
haizhongzheng deleted the task-env/final-fixes branch November 20, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0