Skip to content

Commit c22db4d

Browse files
Continual Harness and Harness² declare the adapter parts they write (#123)
* Continual Harness and Harness² declare the adapter parts they write Both methods write skills and sub-agents (Harness² hooks too), but their evolver.yaml declared `needs: [llm]` and `needs: []`, so a run with an acting agent that drops those parts (react) passed the supports check and trained parts no session ran. They now declare `[llm, skills, agents]` and `[skills, agents, hooks]`, as AHE Adapter does; the CLI agents take every part, so the examples (Codex, Claude Code) are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * CHANGELOG: the needs entry fits Harness², whose adapter never changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 42fbd08 commit c22db4d

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ Changes are grouped by software version. Entries under Unreleased describe work
428428

429429
### Fixed
430430

431+
- Continual Harness and Harness² now declare the adapter parts they write (`needs: [llm, skills, agents]` and
432+
`needs: [skills, agents, hooks]`), so a run whose acting agent does not take them (`react`) is refused before it
433+
starts, instead of running a harness whose skills and sub-agents the acting agent drops.
431434
- In a task's Harbor environment, a CLI's output kept in `/logs/agent` as it ran reached a shared verifier unscrubbed
432435
when Harbor's agent timeout ended the phase before Hermit's own logs were copied over it. The phase's end now scrubs
433436
each such stream there of the credentials passed to the agent's commands (their variables and descriptors) before

‎hermit/agent/evolver/methods/continual_harness/evolver.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ description: Continual Harness's Refiner (Karten et al. 2026, arXiv:2605.09998;
88
score is optimised and no validation gate is applied - every pass is applied in place, as the paper's reset-free
99
loop does; a pass whose result fails the template check is dropped, the others stand.
1010
class: evolver.py:ContinualHarnessEvolver
11-
needs: [llm] # it calls the run's model (ctx.agent, the llm tool)
11+
needs: [llm, skills, agents] # it calls the run's model (ctx.agent, the llm tool); the skills and sub-agents its
12+
# Refiner writes, which the acting agent runs
1213
params:
1314
components: [policy, subagents, skills, memory] # the passes to run, in this order
1415
feedback: true # show the judge's feedback to the Refiner (off: trajectory-only, as the paper's setting)

‎hermit/agent/evolver/methods/harness2_upstream/evolver.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Harness² (Xu et al., arXiv:2610.14224) under the paper's own proto
77
upstream's claude_cli channel on the bound model or on a login, each in its own sandbox; executions go through
88
run_agent, with the run's acting agent (Codex, Claude Code or Pi). No judge score reaches any session.
99
class: evolver.py:Harness2UpstreamEvolver
10-
needs: []
10+
needs: [skills, agents, hooks] # the harness's components the editors write, which the acting agent runs
1111
params:
1212
backend: claude # the editor sessions run Claude Code (upstream's claude_cli channel) on the bound model;
1313
# codex: Codex (a model only Codex reaches: login: chatgpt with model a Codex model name);

‎tests/core/test_environment.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,20 @@ def test_a_method_that_needs_tools_is_refused_an_agent_that_takes_none(tmp_path)
294294
assert adapter_needs_errors(sandboxed, ["tools"]) == []
295295

296296

297+
@pytest.mark.parametrize("method,parts", [("ahe_adapter", "skills, agents, hooks"),
298+
("continual_harness", "skills, agents"),
299+
("harness2_upstream", "skills, agents, hooks")])
300+
def test_a_method_whose_harness_has_skills_and_roles_is_refused_react(tmp_path, method, parts):
301+
"""A method that writes skills and sub-agents (and hooks) declares them: a run whose agent drops them is refused."""
302+
from hermit.agent.evolver.loader import find
303+
from hermit.trainer.trainer import adapter_needs_errors
304+
needs = find(method).needs
305+
react = _config(tmp_path, {"name": "react", "params": {"model": {"base_url": "u", "model": "m"}}}, method)
306+
assert f"acting agent {parts}, which agent react" in adapter_needs_errors(react, needs)[0]
307+
codex = _config(tmp_path, {"name": "codex", "params": {"web_search": False}}, method)
308+
assert adapter_needs_errors(codex, needs) == []
309+
310+
297311
def _declared_supports(file: Path, name: str):
298312
"""A task class's or function's `supports`, read from its source without importing it (None: not declared)."""
299313
import ast

0 commit comments

Comments
 (0)