Manuscript Offprint
arXiv:2610.28069Training the Whole Agent, Not Just the Model
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Lingxiao Tang, Wei Tao, Yiwen Guo, Lingfeng Bao
Zhejiang University LIGHTSPEED Independent Researcher
lingxiaotang@zju.edu.cn wtao@ieee.org
guoyiwen89@gmail.com lingfengbao@zju.edu.cn
Training coding agents typically updates the policy while keeping the harness fixed. During training, trajectories reveal flawed repair strategies and interaction problems that vary across tasks and change as the policy learns. We introduce HarnessAdapt-RL, which trains the policy and adapts its harness during reinforcement learning. For flawed repair strategies, a frozen teacher generates task-specific mechanism-level skills. For interaction problems recurring across tasks, a separate teacher model evolves tools and hooks, keeping each change only if it improves the observed pass rate or the observed trainable rate without lowering either. The policy trains with the adapted harness, and its new trajectories guide further adaptation. With a 9B base model, HarnessAdapt-RL improves pass@1 over GRPO by 9.8, 12.6, and 6.4 percentage points on SWE-bench Verified, Multilingual, and Pro, and outperforms GRPO with the human-designed OpenHands harness. Gains from mechanism-level skills persist after their removal at evaluation. Re-evolving tools and hooks as the policy changes outperforms freezing early versions. Removing them at deployment, in contrast, costs up to 7.7 percentage points. Training therefore produces a model–harness pair: the trained policy and the evolved tools and hooks, with skills removed at deployment.
Code: github.com/lingxiaotang/HarnessAdapt-RL
Date: October 2026
1 Introduction
A coding agent operates as a model–harness pair: the model selects actions, while the harness provides guidance, tools, and runtime feedback. Agent training typically improves the policy while keeping the harness fixed [1–3]. The harness shapes the interaction trajectories used to update the policy, affecting both the effectiveness of training and the performance of the trained agent [4]. Prior work has explored both harness optimization and training-time guidance. Previous methods optimize the harness while keeping the policy fixed [5–7]. Other methods use skills and training guidance to improve policy learning from trajectories [8–10]. Co-Harness alternates harness updates with supervised fine-tuning on trajectories generated by the improved harness [4].
We study harness adaptation during reinforcement learning for coding agents. During training, trajectories expose flawed repair strategies, such as incorrect diagnoses or fixes that only address symptoms. They also reveal interaction problems, such as failed editing commands, excessive output, or insufficient verification. This evidence can guide changes to skills, tools, and runtime hooks that help alleviate these problems. As the problems vary across tasks and change with the policy, the harness needs to adapt throughout training (Appendix C.3). We therefore ask how to design skills for policy learning, how to design and select tools and hooks as the policy changes, and which harness components to retain at deployment.
To address these questions, we introduce HarnessAdapt-RL, which trains the policy and adapts its harness during reinforcement learning. In our setting, skills are textual guidance supplied to the policy during training. First, we compare three skill-guidance variants and use mechanism-level skills that explain when and why a repair strategy applies without providing concrete answers. A frozen teacher model generates these task-
*Work is done during internship at LIGHTSPEED.
Equal contribution: Lingxiao Tang and Wei Tao.
Corresponding authors: Yiwen Guo (guoyiwen89@gmail.com) and Lingfeng Bao (lingfengbao@zju.edu.cn).
specific skills from training trajectories. Second, a separate teacher model identifies recurring interaction and feedback problems across tasks and proposes changes to tools and hooks. Harness selection considers both task success and the availability of rollouts for policy updates (Section 3.3). Each proposal is kept only if it improves the observed pass rate or the observed trainable rate without lowering either (Appendix B.2). We refer to this process as tool and hook evolution. The policy then trains with GRPO [11] on fresh rollouts using the evolved tools and hooks and skills for assisted tasks. Trajectories from the updated policy guide later proposals. Third, we examine which components should remain at deployment. We evaluate the policy after removing skills and compare performance with and without the evolved tools and hooks.
With a 9B base model, HarnessAdapt-RL improves pass@1 over GRPO by 9.8, 12.6, and 6.4 percentage points on SWE-bench Verified [12], Multilingual [2], and Pro [13]. It also outperforms GRPO training with the human-designed OpenHands harness on all three benchmarks. Under the same base harness, models trained with mechanism-level skills perform best among the three skill-guidance variants when evaluated without skills. Re-evolving tools and hooks as the policy changes outperforms keeping their early versions fixed. Holding the trained policy weights fixed, removing the evolved tools and hooks at evaluation reduces pass@1 by up to 7.7 percentage points. Together, these results show that gains from skills persist after their removal, while the evolved tools and hooks remain necessary for full performance at deployment.
Our contributions are threefold:
• Skill design for policy learning. We compare three skill-guidance variants and find that mechanism-level skills yield the best repair performance after guidance is removed.
• Tool and hook evolution during reinforcement learning. We use current-policy trajectories to propose tools and hooks and select changes using both the pass rate and the trainable rate.
• Training and deploying the model-harness pair. We show that gains from skill guidance persist after its removal, while retaining the evolved tools and hooks at deployment preserves the complete performance.
Training and deployment. Training starts from pretrained weights and the base runtime configuration . A frozen teacher model generates skills for assisted tasks from current-policy trajectories. A separate teacher model uses these trajectories to propose changes to tools and hooks. Proposed tool and hook changes are evaluated before acceptance. The policy learns from fresh rollouts with this support. At deployment, skills are removed, and the trained policy is paired with the final runtime configuration . The deployed agent is therefore represented by . On unseen tasks, we evaluate
Here, indicates whether the submitted patch passes the task tests. Skill generation and tool and hook selection use only training-side evidence.
3 Method: Training the Whole Agent
Figure 1 summarizes HarnessAdapt-RL. A teacher model uses current-policy trajectories to generate task-specific skills for flawed repair strategies. A separate teacher model proposes changes to tools and hooks for

Figure 1 Overview of HarnessAdapt-RL. Two separate teachers derive skills and propose tools and hooks from current-policy trajectories. is kept only if it improves the observed pass rate or the observed trainable rate without lowering either. Deployment keeps the trained policy and the final tools and hooks, without skills or teachers.
recurring interaction problems across tasks. We accept a proposal only if it improves the observed pass rate or the observed trainable rate without lowering either. The policy then trains through GRPO [11] on rollouts generated with the adapted harness. Its new trajectories then guide subsequent harness adaptation.
3.1 Policy-Adaptive Repair Skills
We generate skills from training trajectories to guide the policy’s repair strategies. Prior work finds that many skills do not improve software engineering performance [16]. We therefore compare three ways of generating skills and assess the model’s performance after training, with the skills removed.
We first evaluate a skill bank with a fixed capacity, based on prior work that extracts reusable strategies from trajectories [17, 18]. The teacher reviews trajectories across training tasks and adds, removes, merges, or updates general repair skills. This approach does not consistently improve performance over GRPO, suggesting that these skills are too general to help with individual repair tasks (Section 4.3). A more task-specific alternative is to provide near-answer hints with concrete code changes, including variable, function, or class names. These hints produce shorter trajectories and higher training success, but the trained model performs worse than GRPO when evaluated without them (Section 4.3, Appendix C.2). We therefore propose mechanism-level skills that focus on the policy's flawed repair strategies while leaving the policy to work out the concrete solution.
For each assisted task, the teacher model compares two trajectories from the current policy. Using the issue and the evidence in these trajectories, it identifies a repair strategy and explains when and why it applies. The resulting mechanism-level skill retains the technical reasoning behind the repair but omits repository paths, code symbols, and literal code. This guides the policy's repair strategy while leaving code localization and implementation to the policy. Appendices A.2 and D.2 provide generation details and examples.
3.2 Evolving Tools and Hooks for Policy Training
Training trajectories also reveal recurring problems in how the policy interacts with its environment. The teacher uses this evidence to propose changes to tools and hooks. To support both task performance and policy learning, it uses the pass rate and the trainable rate to guide these proposals. Trainable rollouts are those usable for policy updates (Appendix B.2).
The teacher uses current-policy trajectories and the current harness to develop a proposal in four steps. (1)
Find recurring problems. The teacher compares trajectories across tasks to identify recurring problems in tool use and feedback. (2) Inspect trajectories. The teacher reads the tool calls, outputs, and hook messages to understand each recurring problem. For example, the policy runs fewer verification tests later in training, even though it has testing tools and receives reminders. The teacher inspects these trajectories to understand why the policy skips tests before submitting a patch. (3) Design changes. To address the identified problems, the teacher can propose one or more tools, hooks, or a combination of both. Tools package repair operations into reusable actions. Hooks give the policy feedback during execution. In the testing example, the teacher modifies the patch-preparation tool so that it automatically runs related tests when preparing a patch. A hook then reports any test failures and reminds the policy to check them before submission. (4) Implement the proposal. The teacher implements the proposed changes as a candidate harness for evaluation.
As the policy learns, its new trajectories guide further adaptation of tools and hooks (Appendix C.3). Appendix B.2 provides the full proposal procedure.
3.3 Training-Aware Harness Selection
We select harness changes to support both task success and policy learning. GRPO uses reward differences among attempts on the same task to update the policy [11, 19]. Groups in which all attempts succeed or all fail provide no reward contrast for policy updates. Successful rollouts in an all-success group therefore count toward the pass rate without contributing to policy learning. To account for training usability, we also measure the trainable rate, the fraction of sampled rollouts eligible for policy updates (Appendix B.2).
We evaluate each proposal by running the candidate and current harnesses with the same policy, tasks, skills, and rollout budget. We accept the proposal only if it improves the observed pass rate or the observed trainable rate without lowering either. These rates are empirical fractions from the finite comparison rollouts; the acceptance rule does not test statistical significance. Accepted changes are used for subsequent policy training. Otherwise, training continues with the current tools and hooks. Changes from a rejected proposal can be proposed again in later rounds.
Policy updates. After selection, we collect fresh rollouts with the selected tools and hooks, providing skills for assisted tasks. Preparation and comparison rollouts are not reused for training. We update the policy with GRPO using the new rollouts, with loss computed only on policy-generated tokens [11].
Evolution across training epochs. Each training epoch begins with up to five rounds of tool and hook evolution. After each round, we update the policy using the selected tools and hooks. These tools and hooks then stay fixed for the remaining training steps in that epoch. The first epoch produces . The second epoch starts from and uses trajectories from the updated policy to evolve .
4 Experiments
4.1 Experimental Setup
Training setup. We train on a fixed subset of the R2E-Gym-Lite training split [1], shared across all training configurations. The training tasks are disjoint from the evaluation benchmarks. In HarnessAdapt-RL, skills are provided for all training tasks in the first epoch and a fixed subset in the second. Appendix A.1 details task selection and the assisted subset. Our base model is Qwen3.5-9B [20], and the base harness uses mini-swe-agent [15]. We use the frozen GLM-5.3-Flash teacher [21] to generate skills, and GPT-5.6 Sol [22] through Codex [23] to propose and implement tools and hooks. Appendix B.1 records the model identifiers and access interfaces. Policy training uses GRPO [11]. A submitted patch receives a reward of 1 if it passes the task tests and 0 otherwise. The GRPO baseline receives twice as many policy-training rollouts as the other trained configurations. Appendix B gives implementation details and hyperparameters, and Appendix C.7 reports the additional costs of preparation, harness comparison, and teacher calls.
Configurations. Base model uses the initial policy and base harness without training. GRPO trains the policy with and no skills. OpenHands-GRPO uses the human-designed OpenHands harness, also without skills [24].
To compare three ways of generating skills, Skill-Hint, Skill-Mechanism, and Skill-Bank use near-answer hints, mechanism-level skills, and general repair skills from a skill bank, respectively. All three train the policy with the base harness .
We compare three further configurations to test whether tools and hooks need to adapt as the policy learns. All three use mechanism-level skills during policy training. Our full method, HarnessAdapt-RL, alternates policy updates with tool and hook evolution in both epochs.
Pre-Evolved tests whether evolving tools and hooks before policy training is enough. It follows the same search steps and uses the same tasks as HarnessAdapt-RL. However, the policy stays fixed at the base model throughout the search. It then trains the policy for two epochs with the resulting harness fixed.
Mechanism tests whether tools and hooks need to evolve again in the second epoch. It shares the first epoch with HarnessAdapt-RL, so both start the second epoch with the same policy checkpoint and harness . Both continue training the policy, but Mechanism keeps fixed, while HarnessAdapt-RL evolves it into . Appendix C.6 reports additional fixed-harness configurations.
Evaluation. We report pass@1 on SWE-bench Verified [12, 25], SWE-bench Multilingual [2], and SWE-bench Pro [13]. Each evaluation run uses one attempt per task. We repeat each evaluation three times and report the mean pass@1. We assess statistical significance using paired bootstrap confidence intervals for performance differences (Appendix C.4). All configurations use the same evaluation limits (Appendix A.3). Evaluation uses no skills, teacher assistance, or further harness updates. Table 1 compares complete agents, each evaluated with its deployment harness.
4.2 Main Results
HarnessAdapt-RL performs best on average. HarnessAdapt-RL achieves an average pass@1 of 44.9%, the highest in Table 1, compared with 35.3% for GRPO. Its gains over GRPO are 9.8, 12.6, and 6.4 percentage points on Verified, Multilingual, and Pro, respectively. Both use the same 9B base model, and evaluation uses no skills or teacher calls.
The gains also hold against OpenHands-GRPO. OpenHands-GRPO trains the same base model with a human-designed harness instead of . HarnessAdapt-RL exceeds it by 6.2, 4.0, and 7.4 percentage points on the three benchmarks. The advantage is therefore not limited to comparison with the minimal base harness.
Mechanism-level skills perform best after removal. The three skill variants use the same base harness , so they compare different ways of generating skills. After the skills are removed, the model trained with mechanism-level skills reaches an average score of 38.3%, compared with 32.7% for near-answer hints and 34.1% for skill-bank generation. Only mechanism-level skills improve performance over GRPO on all three benchmarks. Near-answer hints achieve higher training success, but this does not lead to better performance without the hints (Section 4.3).
Evolution during training improves performance compared to pre-training search. Pre-Evolved uses the same search steps and tasks as HarnessAdapt-RL, but its policy remains at the base model throughout the search. Both configurations use mechanism-level skills when training the policy. HarnessAdapt-RL scores 2.4, 4.3, and 2.7 percentage points higher on Verified, Multilingual, and Pro. These results favor using trajectories from the updated policy to improve tools and hooks.
| Variant | Skill | Harness | SWE-Verified | SWE-Multilingual | SWE-Pro | Avg. |
|---|---|---|---|---|---|---|
| Base model | ✕ | 42.2 | 19.3 | 31.8 | 31.1 | |
| GRPO | ✕ | 47.8 | 24.7 | 33.3 | 35.3 | |
| OpenHands-GRPO | ✕ | OpenHands | 51.4 | 33.3 | 32.3 | 39.0 (+3.7) |
| Skill-Hint | Hint | 45.4 | 22.3 | 30.4 | 32.7 (-2.6) | |
| Skill-Mechanism | Mechanism | 52.2 | 28.0 | 34.6 | 38.3 (+3.0) | |
| Skill-Bank | Bank | 48.2 | 20.3 | 33.8 | 34.1 (-1.2) | |
| Pre-Evolved | Mechanism | 55.2 | 33.0 | 37.0 | 41.7 (+6.4) | |
| Mechanism | Mechanism | 55.4 | 32.7 | 37.7 | 41.9 (+6.6) | |
| HarnessAdapt-RL | Mechanism | 57.6 | 37.3 | 39.7 | 44.9 (+9.6) |
Table 1 Pass@1 (%) on three repair benchmarks. All configurations are evaluated without skills and retain their final harness. Avg. is the mean across benchmarks. Parentheses show the difference from GRPO in percentage points.
Evolving tools and hooks again in the second epoch improves performance. +Mechanism and HarnessAdapt-RL share the first epoch and start the second with the same policy checkpoint and . Both continue training the policy, but only HarnessAdapt-RL evolves the tools and hooks again. This raises pass@1 over +Mechanism by 2.2, 4.6, and 2.0 percentage points on Verified, Multilingual, and Pro. Later trajectories show that the policy runs fewer verification tests despite having testing tools and reminders. The teacher changes the tool that prepares the patch so that it automatically runs related tests. A hook then reports any test failures and reminds the policy to check them before submission (Section 4.4).
4.3 Why Mechanism-Level Skills?
Figure 2 shows that skill-bank training closely follows GRPO in both training success and Verified performance. This suggests that its general repair strategies offer limited help for individual tasks. Near-answer hints increase training success substantially, but the trained model performs worse than GRPO after skills are removed. Mechanism-level skills improve training success while also achieving the best performance without skills. Higher success during training does not necessarily lead to better performance after training.
To examine this difference, we first compare the rewards of attempts on the same task. GRPO uses these reward differences to update the policy [11, 19]. When every attempt succeeds or every attempt fails, the rewards cannot distinguish better attempts. With mechanism-level skills, 46.5% of sampled groups contain both successful and failed attempts, compared with 39.0% with near-answer hints. The latter produce more groups in which every attempt succeeds (Appendix C.1). Their higher success rate therefore also comes with more groups that provide no reward difference for learning.
Providing concrete answers also changes what the policy needs to do during training. These answers allow it to skip many steps required for independent repair, including locating the relevant code and deciding how to modify it. Providing concrete answers reduces the average number of tokens per rollout by 40.8% relative to

a Training

b SWE-bench Verified (base harness)

Figure 2 Training success and Verified performance without skills. Faint lines show individual updates, bold lines five-update trailing means; dashed lines separate the two training epochs.
GRPO, compared with 14.5% for mechanism-level skills. The trajectories are much shorter. However, they can leave out too many steps needed to solve the task independently. At evaluation, the policy must complete these steps without assistance. The model trained with concrete answers performs worse than GRPO after skills are removed (Appendix C.2).
4.4 How Do Tools and Hooks Evolve During Training?
Figure 3 reports the relative changes in pass rate and trainable rate for each candidate compared with the current harness.
Early evolution targets context management and patch submission. Reading and search tools limit the text returned in each call, preserving context for later repair steps. Editing tools apply changes directly, reducing the need for shell commands that can fail because of quoting or syntax errors. The first proposal containing these tools raises the pass rate by 13.7% and the trainable rate by 7.4%. Later proposals add tools that generate patches and display code changes, helping the policy prepare and check its submission. Hooks flag repeated actions and remind the policy to reserve steps for checking and submission. The accepted changes form (Table 12).

Figure 3 Relative changes (%) in pass rate and trainable rate for each candidate compared with the current harness in the same round.
Later evolution focuses on testing and revising re-
pairs. With kept fixed, the policy runs fewer verification tests in the second epoch despite having a testing tool and reminders (Appendix C.3). The teacher adds automatic testing to the tool that prepares the patch. It selects and runs tests related to the changed code. A hook reports failures and reminds the policy to inspect them before submission. This proposal raises the pass rate by 6.3% and the trainable rate by 7.4%.
Revised budget reminders discourage repeatedly running every test in the repository while still encouraging tests for the current repair. Another proposal helps the policy undo unsuccessful edits. When a Git command for undoing changes is blocked, a hook recommends the new restore_file tool. This tool restores one file to its original version while preserving edits to other files, so the policy does not have to discard its other work. Both proposals improve the two rates and become part of (Table 14).
A rejected proposal. One proposal adds a hook that asks the policy to compare its patch with the task requirements and identify parts that have not been checked. It raises the pass rate by 2.7% but lowers the trainable rate by 7.0%, so it is rejected. In a later round, the teacher combines review with view_diff. This tool displays the lines added, changed, or deleted in selected files, letting the policy inspect its actual edits during review. The later proposal improves both rates and is accepted. A component from a rejected proposal can therefore be reconsidered in a later proposal. Appendix C.8 gives the remaining rejected proposals and the complete evolution record.
4.5 Why Train and Deploy with the Evolved Harness?
We next examine whether the evolved tools and hooks should remain with the policy at deployment. Both Skill-Mechanism and HarnessAdapt-RL use mechanism-level skills during training. Skill-Mechanism trains with , while HarnessAdapt-RL trains as its tools and hooks evolve. After training, we keep each policy fixed and evaluate it under both and . All skills are removed for evaluation (Table 2).
Adding at evaluation improves performance. Skill-Mechanism benefits from on all three benchmarks, although it was trained only with . Its Verified score rises from 52.2% to 54.2%. This improvement comes from changing the tools and hooks, without any additional policy training.
Training with the harness brings larger gains. Switching from to at evaluation raises HarnessAdapt-RL's Verified score by 4.8 percentage points, compared with 2.0 percentage points for Skill-Mechanism. The same pattern holds on Multilingual and Pro. The difference between these gains is statistically significant when the three benchmarks are combined (Appendix C.4). These results support training the policy with the tools and hooks it will use at deployment.
Removing the evolved tools and hooks lowers performance. Replacing with reduces HarnessAdapt-RL's pass@1 by 4.8, 7.7, and 4.7 percentage points on Verified, Multilingual, and Pro, respectively. These drops occur without any change to the policy weights. Retaining the evolved tools and hooks is therefore necessary to preserve the trained agent's full performance. The deployed model–harness pair consists of the trained policy and these tools and hooks, with skills removed.
4.6 Can the Evolved Harness Be Reused for Training?
We compare reusing with searching for a harness before policy training. Frozen-+Mechanism reuses discovered by HarnessAdapt-RL. Pre-Evolved instead searches with the base policy fixed, using the same search steps and tasks as HarnessAdapt-RL. After obtaining their harnesses, both variants train a new policy from the same base model. Their tools and hooks remain fixed throughout training. We provide mechanism-level skills on the same schedule as in the full method (Section 4.1).
Frozen-+Mechanism reaches 56.8%, 38.3%, and 38.9% on Verified, Multilingual, and Pro, respectively. These scores are within 1.0 percentage point of HarnessAdapt-RL on every benchmark (Figure 4). They also exceed Pre-Evolved by 1.6, 5.3, and 1.9 percentage points. Thus, reusing the harness discovered during policy training gives better results than using the harness found before training.
Frozen-+Mechanism achieves similar scores to HarnessAdapt-RL. However, it reuses a harness that HarnessAdapt-RL has already discovered during pol-
icy training. In our experiments, searching with the fixed base policy does not produce a harness with the same performance. The strong reuse result therefore depends on first discovering through evolution during training. Once is available, this evolution does not need to be repeated in the new training run.
| Model | Harness | Verified | Multi. | Pro |
|---|---|---|---|---|
| Skill-Mechanism | 52.2 | 28.0 | 34.6 | |
| 54.2 (+2.0) | 33.3 (+5.3) | 36.9 (+2.3) | ||
| HarnessAdapt-RL | 52.8 | 29.6 | 35.0 | |
| 57.6 (+4.8) | 37.3 (+7.7) | 39.7 (+4.7) |
Table 2 Pass@1 (%) without skills under and . Parentheses show each model's gain from to in percentage points.
a Discover , then reuse it
During training
New training run

b Difference from HarnessAdapt-RL

Figure 4 Pass@1 differences (percentage points) from HarnessAdapt-RL. Frozen-+Mechanism and Pre-Evolved both train with fixed harnesses and mechanism-level skills, then remove skills at evaluation.
5 Related Work
Skills and policy learning. Voyager builds reusable skills from interaction [26], while SkillRL combines skill evolution with reinforcement learning [18]. Agentic Context Engineering (ACE) maintains a playbook of strategies and updates it using feedback from the agent's interactions [27]. Socratic-SWE uses skills derived from trajectories to generate training tasks [8]. Hindsight Hint Distillation trains on trajectories generated with hints, while PATS adjusts guidance to the current policy [9, 10]. Both remove this guidance at deployment. We compare near-answer hints, mechanism-level skills, and general skills from a skill bank in software repair. Our comparison focuses on the trained model's performance after skills are removed.
Harness design and optimization. Tool interfaces and feedback affect agent behavior [15, 28, 29]. Meta-Harness automates harness search using earlier candidates and their execution trajectories [5]. Retrospective Harness Optimization (RHO) updates skills and tools from past trajectories, selecting changes through the agent's own preferences without external grading [30]. Other methods use revision history, reference trajectories, or interactions across tasks to guide changes [6, 7, 31]. These methods keep model weights fixed during harness optimization. We evolve tools and hooks during policy training. The teacher uses trajectories from the updated policy to propose changes for newly observed problems. Our experiments compare this approach with search under a fixed base policy.
Policy training and harness adaptation. CoEvolve adapts training data alongside the policy [32], while SEARL jointly optimizes the policy and tool graph memory [33]. ClawGym II studies reinforcement learning with complex harnesses [34]. Co-Harness alternates harness updates with supervised fine-tuning (SFT) on trajectories generated by the improved harness [4]. HarnessAdapt-RL combines GRPO with tool and hook selection based on the pass rate and trainable rate. A proposal is accepted only if at least one observed rate improves and neither decreases. We also examine which components are needed at deployment. We test whether skill gains persist after removal and how removing the evolved tools and hooks affects performance.
6 Conclusion
We introduced HarnessAdapt-RL, which trains coding agents with GRPO and adapts their harnesses from training trajectories. It generates task-specific skills and evolves tools and hooks as the policy learns. A proposal is accepted only if it improves the observed pass rate or the observed trainable rate without lowering either. With a 9B base model, HarnessAdapt-RL improves pass@1 over GRPO by 9.8, 12.6, and 6.4 percentage points on SWE-bench Verified, Multilingual, and Pro. It also outperforms OpenHands-GRPO. Mechanism-level skills outperform near-answer hints and general skills from a skill bank after skills are removed. Evolving tools and hooks during policy training performs better than searching only before training or keeping the first-epoch harness fixed. Once discovered, the evolved harness can support a new training run without further evolution. Removing its tools and hooks at deployment lowers pass@1 by up to 7.7 percentage points. Training therefore produces a model–harness pair: the trained policy and the evolved tools and hooks, with task-specific skills removed at deployment.
Data Availability
The model weights, evolved harness, training code, and data are available at https://github.com/lingxiaotang/HarnessAdapt-RL.
Limitations
All tasks are software repair from SWE-bench-style benchmarks, and the skills, tools, and hooks were derived for this setting. We have not tested whether the same procedure produces useful support in other agent domains, such as web navigation or data analysis. We also use a single 9B base model. We do not know whether larger models, which may already handle many of the operations that our tools package, would benefit from harness evolution to the same extent, or whether the preferred form of guidance would stay the same across model families.
Each configuration is trained once. The three repetitions are evaluations of a fixed trained checkpoint, not independent training runs (Appendix B.4). The reported confidence intervals characterize task-level variation for these checkpoints; they do not quantify variability across training seeds or independent harness-search runs.
Candidate selection uses observed pass and trainable rates from a finite rollout comparison (Appendix B.2). Its acceptance rule is not a significance test: an observed improvement need not imply an improvement in the underlying success or trainability probabilities. Rollout noise and repeated candidate search can therefore affect which changes are retained. The statistical analysis of the final evaluations does not remove this uncertainty from the search process.
References
[1] Naman Jain, Jaskirat Singh, Manish Shetty, Tianjun Zhang, Liang Zheng, Koushik Sen, and Ion Stoica. R2E-Gym: Procedural environment generation and hybrid verifiers for scaling open-weights SWE agents. In Second Conference on Language Modeling, 2025. URL https://openreview.net/forum?id=7evvwdo3z.
[2] John Yang, Kilian Lieret, Carlos E. Jimenez, Alexander Wettig, Kabir Khandpur, Yanzhe Zhang, Binyuan Hui, Ofir Press, Ludwig Schmidt, and Diyi Yang. SWE-smith: Scaling data for software engineering agents. In Advances in Neural Information Processing Systems, 2025. URL https://proceedings.neurips.cc/paper_files/paper/2025/hash/8b86cf5ace600c48fd188efbb8dedec8-Abstract-Datasets_and_Benchmarks_Track.html.
[3] Zhiheng Xi, Jixuan Huang, Chenyang Liao, Baodai Huang, Jiaqi Liu, Honglin Guo, Yajie Yang, Rui Zheng, Junjie Ye, Jiazheng Zhang, Wenxiang Chen, Wei He, Yiwen Ding, Guanyu Li, Zehui Chen, Zhengyin Du, Xuesong Yao, Yufei Xu, Jiecao Chen, Tao Gui, Zuxuan Wu, Qi Zhang, Xuanjing Huang, and Yu-Gang Jiang. AgentGym-RL: An open-source framework to train LLM agents for long-horizon decision making via multi-turn RL. In International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=ZgCCDwcGwn.
[4] Zhengyu Chen, Teng Xiao, Huaisheng Zhu, Yige Yuan, Luan Zhang, and Jingang Wang. Co-Harness: Co-evolving harnesses and model weights for LLM agents. arXiv preprint arXiv:2607.22688, 2026. URL https://arxiv.org/abs/2607.22688.
[5] Yoonho Lee, Roshen Nair, Qizheng Zhang, Kangwook Lee, Omar Khattab, and Chelsea Finn. Meta-Harness: End-to-end optimization of model harnesses. arXiv preprint arXiv:2603.28052, 2026. URL https://arxiv.org/abs/2603.28052.
[6] Wen Jiang, Mingmin Chu, Yimeng Tian, Qianxin Zhang, Haofei Yang, Rui Yang, Yang Liu, Tao Lv, and Fangming Li. HarnessEvolve: Learning from reference trajectories for reliable agent self-evolution. arXiv preprint arXiv:2609.00829, 2026. URL https://arxiv.org/abs/2609.00829.
[7] Yuetian Du, Yucheng Wang, He Xu, Jiexu Xu, Shanwen Tan, Bing Zhao, Boyu Yang, Zhijie Xu, Ming Kong, Hu Wei, Jie Liu, and Qiang Zhu. Living-Harness is an interactive-agent evolver. arXiv preprint arXiv:2607.26598, 2026. URL https://arxiv.org/abs/2607.26598.
[8] Chuan Xiao, Zhengbo Jiao, Shaobo Wang, Wei Wang, Bing Zhao, Hu Wei, Linfeng Zhang, and Lin Qu. Socratic-SWE: Self-evolving coding agents via trace-derived agent skills. arXiv preprint arXiv:2606.07412, 2026. URL https://arxiv.org/abs/2606.07412.
[9] Shengjie Wang, Guanghe Li, Zonghan Yang, and Yang Gao. Hindsight hint distillation: Scaffolded reasoning for SWE agents from CoT-free answers. arXiv preprint arXiv:2605.11556, 2026. URL https://arxiv.org/abs/2605.11556.
[10] Yipeng Shi, Zhipeng Ma, Yue Wang, Qitai Tan, Yang Li, Peng Chen, and Zhengzhou Zhu. PATS: Policy-aware training scaffolding for agentic reinforcement learning. arXiv preprint arXiv:2607.21419, 2026. URL https://arxiv.org/abs/2607.21419.
[11] Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. DeepSeekMath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.
[12] Neil Chowdhury, James Aung, Chan Jun Shern, Oliver Jaffe, Dane Sherburn, Giulio Starace, Evan Mays, Rachel Dias, Marwan Aljubeh, Mia Glaese, Carlos E. Jimenez, John Yang, Leyton Ho, Tejal Patwardhan, Kevin Liu, and Aleksander Madry. Introducing SWE-bench verified. OpenAI blog, 2024. URL https://openai.com/index/introducing-swe-bench-verified/.
[13] Xiang Deng, Jeff Da, Edwin Pan, Yannis Yiming He, Charles Ide, Kanak Garg, Niklas Lauffer, Andrew Park, Nitin Pasari, Chetan Rane, Karmini Sampath, Maya Krishnan, Srivatsa Kundurthy, Sean Hendryx, Zifan Wang, Vijay Bharadwaj, Jeff Holm, Raja Aluri, Chen Bo Calvin Zhang, Noah Jacobson, Bing Liu, and Brad Kenstler. SWE-Bench Pro: Can ai agents solve long-horizon software engineering tasks? arXiv preprint arXiv:2509.16941, 2025. URL https://arxiv.org/abs/2509.16941.
[14] Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. ReAct: Synergizing reasoning and acting in language models. In International Conference on Learning Representations, 2023. URL https://arxiv.org/abs/2210.03629.
[15] John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. SWE-agent: Agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems, 2024. URL https://arxiv.org/abs/2405.15793.
[16] Tingxu Han, Yi Zhang, Wei Song, Chunrong Fang, Zhenyu Chen, Youcheng Sun, and Lijie Hu. SWE-Skills-Bench: Do agent skills actually help in real-world software engineering? arXiv preprint arXiv:2603.15401, 2026. URL https://arxiv.org/abs/2603.15401.
[17] Mirac Suzgun, Mert Yuksekgonul, Federico Bianchi, Dan Jurafsky, and James Zou. Dynamic cheatsheet: Test-time learning with adaptive memory. arXiv preprint arXiv:2504.07952, 2025. URL https://arxiv.org/abs/2504.07952.
[18] Peng Xia, Jianwen Chen, Hanyang Wang, Jiaqi Liu, Kaide Zeng, Yu Wang, Siwei Han, Yiyang Zhou, Xujiang Zhao, Haifeng Chen, Zeyu Zheng, Cihang Xie, and Huaxiu Yao. SkillRL: Evolving agents via recursive skill-augmented reinforcement learning. arXiv preprint arXiv:2602.08234, 2026. URL https://arxiv.org/abs/2602.08234.
[19] Qiying Yu, Zheng Zhang, Ruofei Zhu, Yufeng Yuan, Xiaochen Zuo, Yu Yue, Weinan Dai, Tiantian Fan, Gaohong Liu, Juncai Liu, Lingjun Liu, Xin Liu, Haibin Lin, Zhiqi Lin, Bole Ma, Guangming Sheng, Yuxuan Tong, Chi Zhang, Mofan Zhang, Ru Zhang, Wang Zhang, Hang Zhu, Jinhua Zhu, Jiaze Chen, Jiangjie Chen, Chengyi Wang, Hongli Yu, Yuxuan Song, Xiangpeng Wei, Hao Zhou, Jingjing Liu, Wei-Ying Ma, Ya-Qin Zhang, Lin Yan, Yonghui Wu, and Mingxuan Wang. DAPO: An open-source LLM reinforcement learning system at scale. In Advances in Neural Information Processing Systems, 2025. URL https://proceedings.neurips.cc/paper_files/paper/2025/hash/a4277440d50f1f15d2cb4c14f7e0c0d2-Abstract-Conference.html.
[20] Qwen Team. Qwen3.5: Towards native multimodal agents, February 2026. URL https://qwen.ai/blog?id=qwen3.5.
[21] Z.ai. GLM-5.3-Flash/FlashX: Model overview and api access. Z.AI Developer Documentation, 2026. URL https://docs.z.ai/guides/vlm/glm-5.3-flash. Accessed October 20, 2026.
[22] OpenAI. GPT-5.6 Sol model. OpenAI API documentation, 2026. URL https://developers.openai.com/api/docs/models/gpt-5.6-sol. Accessed October 20, 2026.
[23] OpenAI. Codex is now generally available. OpenAI, October 2025. URL https://openai.com/index/codex-now-generally-available/.
[24] Xingyao Wang, Boxuan Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, Hoang H. Tran, Fuqiang Li, Ren Ma, Mingzhang Zheng, Bill Qian, Yanjun Shao, Niklas Muennighoff, Yizhe Zhang, Binyuan Hui, Junyang Lin, Robert Brennan, Hao Peng, Heng Ji, and Graham Neubig. OpenHands: An open platform for AI software developers as generalist agents. In International Conference on Learning Representations, 2025. URL https://arxiv.org/abs/2407.16741.
[25] Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations, 2024.
[26] Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Voyager: An open-ended embodied agent with large language models. Transactions on Machine Learning Research, 2024. URL https://openreview.net/forum?id=ehfRiF0R3a.
[27] Qizheng Zhang, Changran Hu, Shubhangi Upasani, Boyuan Ma, Fenglu Hong, Vamsidhar Kamanuru, Jay Rainton, Chen Wu, Mengmeng Ji, Hanchen Li, Urmish Thakker, James Zou, and Kunle Olukotun. Agentic context engineering: Evolving contexts for self-improving language models. In International Conference on Learning Representations, 2026. URL https://arxiv.org/abs/2510.04618.
[28] Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: Language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems, 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/hash/1b44b878bb782e6954cd888628510e90-Abstract-Conference.html.
[29] Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, and Peter Clark. Self-Refine: Iterative refinement with self-feedback. In Advances in Neural Information Processing Systems, 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/hash/91edff07232fb1b55a505a9e9f6c0ff3-Abstract-Conference.html.
[30] Wenbo Pan, Shujie Liu, Chin-Yew Lin, Jingying Zeng, Xianfeng Tang, Xiangyang Zhou, Yan Lu, and Xiaohua Jia. Evolving agents in the dark: Retrospective harness optimization via self-preference. arXiv preprint arXiv:2606.05922, 2026.
[31] Hyunin Lee, Jinglue Xu, Jeffrey Seely, Donghyun Lee, Matei Zaharia, and Yujin Tang. Recursive harness self-improvement. arXiv preprint arXiv:2607.15524, 2026. URL https://arxiv.org/abs/2607.15524.
[32] Shidong Yang, Ziyu Ma, Tongwen Huang, Yiming Hu, Yong Wang, and Xiangxiang Chu. CoEvolve: Training LLM agents via agent-data mutual evolution. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 23015–23036. Association for Computational Linguistics, 2026. URL https://aclanthology.org/2026.acl-long.1055/.
[33] Xinshun Feng, Xinhao Song, Lijun Li, Gongshen Liu, and Jing Shao. SEARL: Joint optimization of policy and tool graph memory for self-evolving agents. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 24518–24535. Association for Computational Linguistics, 2026. URL https://aclanthology.org/2026.acl-long.1125/.
[34] Huatong Song, Fei Bai, Ming Yang, Renyuan Li, Jia Deng, Jujie He, Zhange Zhang, Daixuan Cheng, Yan Xing, Qi Yun, Xuxing Chen, Danyang Li, Feng Chang, Chuan Hao, Ran Tao, Jian Yang, Bryan Dai, Wayne Xin Zhao, Mingjie Tang, and Ji-Rong Wen. ClawGym II: Exploring black-box RL on agent harness. arXiv preprint arXiv:2608.16798, 2026. URL https://arxiv.org/abs/2608.16798.
[35] Zonghan Yang, Shengjie Wang, Kelin Fu, Wenyang He, Weimin Xiong, Yibo Liu, Yibo Miao, Bofei Gao, Yejie Wang, Yingwei Ma, Yanhao Li, Yue Liu, Zhenxing Hu, Kaitai Zhang, Shuyi Wang, Huarong Chen, Flood Sung, Yang Liu, Yang Gao, Zhilin Yang, and Tianyu Liu. Kimi-dev: Agentless training as skill prior for SWE-agents. arXiv preprint arXiv:2509.23045, 2025. URL https://arxiv.org/abs/2509.23045.
[36] Shiyi Cao, Dacheng Li, Fangzhou Zhao, Shuo Yuan, Sumanth R. Hegde, Connor Chen, Charlie Ruan, Tyler Griggs, Shu Liu, Eric Tang, Richard Liaw, Philipp Moritz, Matei Zaharia, Joseph E. Gonzalez, and Ion Stoica. SkyRL-Agent: Efficient RL training for multi-turn LLM agent. arXiv preprint arXiv:2511.16108, 2025. URL https://arxiv.org/abs/2511.16108.
[37] Sunghwan Kim, Junhee Cho, Beong-woo Kwak, Taeyoon Kwon, Liang Wang, Nan Yang, Xingxing Zhang, Furu Wei, and Jinyoung Yeo. On training large language models for long-horizon tasks: An empirical study of horizon length. arXiv preprint arXiv:2605.02572, 2026. URL https://arxiv.org/html/2605.02572v1.
[38] Zilin Zhu, Chengxing Xie, Xin Lv, and slime Contributors. slime: An LLM post-training framework for RL scaling. GitHub repository, 2025. URL https://github.com/THUDM/slime. Accessed September 18, 2026.
[39] OpenCode Contributors. OpenCode: The open source coding agent. GitHub repository, 2026. URL https://github.com/anomalyco/opencode. Accessed September 18, 2026.
[40] Michael Luo, Naman Jain, Jaskirat Singh, Sijun Tan, Ameen Patel, Qingyang Wu, Alpay Ariyak, Colin Cai, Tarun Venkat, Shang Zhu, Ben Athiwaratkun, Manan Roongta, Ce Zhang, Li Erran Li, Raluca Ada Popa, Koushik Sen, and Ion Stoica. DeepSWE: Training a fully open-sourced, state-of-the-art coding agent by scaling RL. Together AI blog, 2025. URL https://www.together.ai/blog/deepswe.
[41] Evan Miller. Adding error bars to evals: A statistical approach to language model evaluations. arXiv preprint arXiv:2411.00640, 2024. URL https://arxiv.org/abs/2411.00640.
Appendix
A Data and Harness Specifications
A.1 Task Pool and Assisted Subset
We draw the training pool from the train split of R2E-Gym-Lite [1], which contains 4,578 tasks. We first remove tasks with a pass@4 of 100%, then randomly sample 1,058 of the remaining tasks and use this pool for every training configuration. Table 3 reports its repository distribution.
The 512-task assisted subset is drawn uniformly at random from the pool, without reference to task difficulty, and is held fixed across configurations. For configurations with skills, the first epoch assists all 1,058 tasks and the second as-
| Repository | Tasks | Share | Repository | Tasks | Share |
|---|---|---|---|---|---|
| pandas | 399 | 37.71% | tornado | 62 | 5.86% |
| numpy | 163 | 15.41% | scrapy | 51 | 4.82% |
| orange3 | 124 | 11.72% | datalad | 31 | 2.93% |
| pillow | 122 | 11.53% | coveragepy | 24 | 2.27% |
| aiohttp | 76 | 7.18% | pyramid | 6 | 0.57% |
| Total | 1,058 | 100% |
Table 3 Repository distribution of the training pool.
sists only this subset. Skill-Gated further restricts guidance to tasks whose preparation attempts all fail. Tasks outside the subset keep the current harness but receive no skill. We deduplicate the training pool against SWE-bench Verified, Multilingual, and Pro and find no overlap. Tasks are visited in the same order in every configuration.
A.2 Skill Generation
Teacher inputs. Each assisted task visit starts a skill-generation request, which returns a Markdown response. The teacher sees the issue and trajectory records, including any source code and test output shown in those records. It has no direct repository access and cannot inspect hidden tests or grader artifacts (Table 4). Only the resulting skill is shown to the policy, and neither the teacher nor any training skill is used at evaluation. For mechanism-level skills, the skill describes the repair mechanism rather than reproducing the diff.
Trajectory pairing. The teacher compares two of the four preparation rollouts of a task, preferably one success and one failure. When all rollouts succeed, the pair consists of two successes and the skill describes the shared successful mechanism. When all rollouts fail, the pair consists of two failures, and the teacher decides from the issue and the partial progress in the trajectories which repair direction the skill describes. The skill format is the same in all three cases.
| Input | Visible to the teacher | Use |
|---|---|---|
| Issue | Yes, as the user message in both trajectories | States what the repair must accomplish |
| Trajectories | Two full preparation trajectory records, with outcomes | Behavioral comparison |
| Tests | Only commands and outputs inside the two trajectories | Evidence the policy actually observed |
| Direct repository access | No | – |
| Hidden tests, grader artifacts | No direct access | – |
Table 4 Teacher inputs for skill generation.
Guidance variants. The three variants differ in both specificity and evidence scope. Near-answer hints name the file, function, and variables involved and state the concrete edit. Each mechanism-level skill describes a single repair mechanism, with repository names, paths, symbols, literal code, and diff text removed. Both are generated from a single task, using its issue and the two trajectories with the test outputs they contain. Skill-bank guidance instead summarizes general procedures that recur across tasks. The teacher reads the task reports from the current batch together with the previous meta-skill bank and rewrites the bank into at most ten procedures within 1,000 English words. Evidence identifiers are removed before the bank is shown to the policy. Section 4.3 compares the training and evaluation results of these variants. For Skill-Mechanism, only the Task-specific Skill section of the teacher's response is injected. Appendix D.1 gives the full prompts for all three variants.
Representative outputs. Appendix D.2 shows representative teacher outputs for each guidance type.
Length and leakage control. Excluding the three field labels, mechanism-level skills average 100.67 whitespace-delimited words, with a median of 100 and a maximum of 154. We screen mechanism-level skills for answer-locating paths, symbols, and code. Near-answer hints intentionally include such details and are not subject to this restriction. A mechanism-level skill that fails the screen is regenerated up to three times. If it still fails, the task is trained without a skill.
Second epoch and Skill-Gated. Skills for the second epoch are regenerated rather than reused from the first. Skill-Gated invokes the teacher only when all four preparation attempts of a task fail, and generates the skill from two of these failed trajectories chosen at random.
A.3 Execution Limits and Submission
All configurations share the same execution budgets. Training rollouts allow a 64K context (65,536 tokens) and at most 60 turns, while evaluation allows a 128K context (131,072 tokens) and at most 150 turns. Both use temperature 1.0. The shorter training budget bounds the cost of collecting multiple rollouts per task for each GRPO update. Evaluation makes a single attempt per held-out task, so the longer budget leaves the trained policy room to read, verify, and submit. Prior SWE agents also use shorter context or turn budgets during training than at evaluation [35, 36]. Shorter interaction horizons can also improve reinforcement-learning stability [37].
Truncation and submission. A trajectory is truncated if it exceeds either the turn limit or the context limit, and is counted once if it exceeds both. A submission made on the final allowed turn counts as complete. The prepare_patch tool writes the selected source changes to patch.txt but neither submits nor scores the repair. Submission is a separate Bash action:
echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT && cat patch.txt
The submitted patch is then applied and tested in a fresh task container.
B Implementation and Reproducibility
B.1 Hyperparameters and Schedule
Policy training uses GRPO implemented in slime [38], with a constant learning rate of . GLM-5.3-Flash [21] generates skills through OpenCode [39], and GPT-5.6 Sol [22] designs and implements tool and hook proposals through Codex [23]. The release configuration records the provider model identifiers glm-5.3-flash and gpt-5.6-sol. The setup guide describes the provider endpoints and credentials used by the two CLIs; inference with the released model– pair requires neither teacher. These identifiers do not pin immutable teacher snapshots, and the historical CLI package versions were not preserved. The reproduction setup therefore requires explicit CLI versions to be supplied and records the installed versions.
Training runs for two epochs over the 1,058-task pool. Each epoch consists of 23 updates of 46 tasks , so every batch is full and no task is repeated or padded within an epoch. Updates 1–23 form the first epoch and updates 24–46 the second, for 2,116 task visits in total. The first epoch assists all tasks, and the second assists the fixed 512-task subset with regenerated skills.
GRPO samples 8 rollouts per task, and every other trained configuration samples 4. Each update therefore uses 368 training rollouts for GRPO and 184 for the other configurations, or 16,928 and 8,464 rollouts over the full schedule. Table 5 lists the remaining settings.
| Setting | Value |
|---|---|
| Schedule | |
| Policy | Qwen3.5-9B |
| Batch | 46 task groups per update |
| Updates | 23 per epoch, 46 in total |
| Task visits | 1,058 per epoch, 2,116 in total |
| Rollouts per task | 8 for GRPO, 4 otherwise |
| Rollouts per update | 368 for GRPO, 184 otherwise |
| Training rollouts | 16,928 for GRPO, 8,464 otherwise |
| Optimization | |
| Optimizer | Adam |
| Adam (, , ) | |
| Weight decay | 0.1 |
| Learning rate | , constant |
| Advantage | Group-mean centering, no std. normalization |
| PPO clip | 0.2 (lower), 0.28 (upper) |
| KL / entropy coef. | 0 / 0 |
| Gradient clip | 1.0 |
| Rollout | |
| Context | 64K tokens (65,536) |
| Turns | At most 60 |
| Temperature | 1.0 |
| System | |
| Precision | BF16 |
| Parallelism | TP 2, CP 2, PP 1 |
| Hardware | 8 GPUs |
Table 5 Training hyperparameters.
All trained configurations share the task pool, task order, batch size, number of updates, optimizer, learning rate, clip and KL settings, loss mask, and the training and evaluation budgets. They differ only in rollout width, guidance, and harness. GRPO uses the base harness without skills. Skill-Hint uses near-answer hints, Skill-Mechanism uses mechanism-level skills, and Skill-Bank uses general procedures from a skill bank. All three keep the base harness. Skill-Gated adds mechanism-level skills only when all four preparation attempts fail. OpenHands-GRPO trains without skills under the OpenHands harness and keeps it at evaluation. Pre-Evolved first keeps the base policy fixed and evolves tools and hooks on the task batches corresponding to the first five updates of each epoch of HarnessAdapt-RL. After this search, it trains the policy with mechanism-level skills while keeping fixed. Frozen- trains without skills under , fixed from the first update. HarnessAdapt-RL combines mechanism-level skills with tool and hook evolution in both epochs. The loss is computed only on policy-generated tokens. Skill text, hook messages, and tool outputs are masked out. Preparation rollouts inform skill generation and harness proposals and are excluded from optimization.
B.2 Candidate Generation
In each evolution round, the teacher receives all preparation trajectories from that round, the current harness, and the outcomes of earlier proposals, without subsampling. Within a single call, it analyzes the trajectory evidence, selects a supported problem, and designs and implements one candidate to address it. It returns the diagnosis, design rationale, and concrete code or edits, or no_change when the evidence or available interfaces do not support a useful modification. A bundle may contain several tools and hooks, with corresponding usage instructions, when they serve the same repair workflow. Appendix D.3 gives the full proposal prompt.
The generated code is used without human modification. Before any rollout comparison, we check the candidate's output format, tool schemas, module loading, and a software smoke test. Tools and hooks outside the proposal must remain byte-identical to the current harness, and task-specific skill text must be unchanged. A candidate that fails any check is discarded without comparison.
The comparison follows Section 3.3. Both harnesses are run on fresh rollouts under the same policy, tasks, skills, and rollout budget. The trainable rate is the share of sampled rollouts eligible for policy updates, and the pass rate is the share whose patch passes the task tests. We exclude truncated rollouts from the trainable-rate count, motivated by the loss masking of overlong trajectories in prior LLM and agent RL work [19, 36, 40]. For this metric, we additionally require the remaining rollouts in each task group to include both successful and failed attempts. When this condition holds, the remaining rollouts are eligible, subject to the unknown-reward exclusion in Appendix B.3. If the remaining attempts all succeed or all fail, none are trainable. The denominator for the trainable rate includes all sampled rollouts, including those excluded by these rules. Successful rollouts in an all-success group count toward the pass rate but not the trainable rate. Rollouts with unknown rewards count as non-passing and remain in the denominator. A candidate is accepted if neither observed rate decreases and at least one strictly increases. If both remain unchanged, it is rejected.
Each accepted bundle updates the retained harness. The first-epoch harness contains seven tools and four hooks (Table 12). The second-epoch harness , used by HarnessAdapt-RL at update 45, contains eight tools and five hooks (Table 14). Each training epoch begins with at most five harness-evolution rounds. A rejected candidate or a no_change response also uses one round. The retained harness is fixed for the remaining policy training in that epoch.
B.3 Rollout Accounting
Table 6 reports rollouts per update. Training rollouts follow Appendix B.1. Preparation rollouts are collected only for assisted tasks, four per task, giving 4,232 in the first epoch and 2,048 in the second. HarnessAdapt-RL additionally collects comparison rollouts in rounds that propose a candidate. Each comparison uses 184 fresh rollouts per harness on the same 46 tasks, with four rollouts per task. Comparison rollouts are discarded once the decision is made. Rounds that return no_change require no comparison.
Failed requests are not replaced: an update keeps its scheduled rollouts and does not resample to fill a group. A rollout with an unknown reward is neither a pass nor a confirmed failure. We exclude its group from the policy update in-
| Configuration | Updates | Prep. | Comp. | Train |
|---|---|---|---|---|
| Skill variants | 1–23 | 184 | 0 | 184 |
| 24–46 | 0 | 184 | ||
| HarnessAdapt-RL | 1–23 | 184 | 0 or 368 | 184 |
| 24–46 | 0 or 368 | 184 | ||
| GRPO | 1–46 | 0 | 0 | 368 |
| Frozen- | 1–46 | 0 | 0 | 184 |
Table 6 Sampled rollouts per update. is the number of assisted tasks in the batch. For HarnessAdapt-RL, a candidate comparison adds 368 rollouts, otherwise the comparison count is zero.
instead of assigning a reward of 0. Teacher retries that repair a skill's format do not add training rollouts. In the skill-training run, training rollouts record 14 summary errors, 11 unknown rewards, and 3 timeouts, and first-epoch preparation rollouts record 6 summary errors and 6 unknown rewards. Because these events overlap, we do not sum them into a single failure count.
B.4 Training Runs and Evaluation
Each configuration is trained once. We evaluate the checkpoint from update 45, the last saved checkpoint before training ends at update 46. Checkpoints are saved every five updates, and this choice was made before evaluation. Each evaluation is repeated three times, with one attempt per task in each run. We report the mean pass@1, keeping failed or unfinished attempts in the denominator as incorrect. Appendix C.4 describes the confidence intervals.
Learning curves evaluate Verified every five updates under the same protocol. Their final points equal the reported scores in Tables 1 and 11. Avg. is the unweighted mean of the three reported benchmark scores. The training statistics in Appendices C.1 and C.2 cover all 46 updates of the same runs. They describe sampled groups and rollouts, not unique tasks or independent training replicates.
C Additional Results
C.1 Reward Groups
Section 4.3 discusses the reward composition of sampled rollout groups. A group contains the rollouts for one task visit. Table 7 and Figure 5 classify the sampled outcomes before training filters are applied. Each configuration has 2,116 groups over updates 1–46. GRPO samples eight rollouts per group, while the skill variants sample four. Group size affects the chance of observing mixed outcomes, so comparisons among the skill variants have the same group size, whereas comparisons with GRPO do not. For this descriptive tally, unknown rewards are placed in the failure category: there are 12, 10, 4, 3, and 6 for GRPO, Skill-Hint, Skill-Mechanism, Skill-Bank, and Skill-Gated, respectively. Their groups are excluded from policy updates (Appendix B.3). Thus, these sampled-group counts differ from the groups retained for learning.
Skill-Hint has the largest all-pass share among the skill variants (27.5%), while Skill-Mechanism has the largest mixed-outcome share (46.5%). Skill-Bank and Skill-Gated have distributions close to GRPO's, although their groups contain fewer rollouts. After training filters are applied, mixed outcomes provide the reward contrast used by GRPO [11, 19]. The sampled mixed-group share alone does not measure how much useful training signal remains.
| Configuration | All fail | Mixed | All pass |
|---|---|---|---|
| GRPO | 1,076 (50.9) | 876 (41.4) | 164 (7.8) |
| Skill-Hint | 710 (33.6) | 825 (39.0) | 581 (27.5) |
| Skill-Mechanism | 841 (39.7) | 984 (46.5) | 291 (13.8) |
| Skill-Bank | 1,064 (50.3) | 876 (41.4) | 176 (8.3) |
| Skill-Gated | 1,071 (50.6) | 873 (41.3) | 172 (8.1) |
Table 7 Sampled reward-group counts before training filters, with shares (%) in parentheses. Each configuration has 2,116 groups over updates 1–46.

Figure 5 Share of sampled groups by reward outcome before training filters. Skill-Mechanism has the largest share of mixed groups.
C.2 Trajectory Length
Table 8 reports the mean length of training trajectories over updates 1–46, measured in tokens and interaction turns. Successful and failed subsets are defined within each configuration and are not matched by task. Figure 6 relates mean length to Verified performance without skills.
Relative to GRPO, Skill-Mechanism shortens trajectories by 14.5% overall, by 15.3% for successful rollouts, and by 10.5% for failed ones. Skill-Hint shortens them by 40.8% overall and by 39.6% and 36.7% in the two subsets, yet performs worse than GRPO without skills. Shorter training trajectories are therefore not evidence of better learning on their own. Because aggregate means mix changes in redundancy, verification, and outcome composition, we do not attribute the reduction to a specific behavior.
| Metric | GRPO | Skill-Hint | Skill-Mechanism |
|---|---|---|---|
| Tokens | |||
| All | 32,212 | 19,082 | 27,535 |
| Successful | 24,592 | 14,864 | 20,828 |
| Failed | 34,988 | 22,139 | 31,316 |
| Turns | 52.19 | 34.16 | 47.83 |
Table 8 Mean training-trajectory length over updates 1–46.
| GRPO | Skill-Hint | Skill-Mechanism |
a Training trajectory length

b Length and Verified pass@1

Figure 6 (a) Mean training-trajectory length. (b) Mean length against Verified pass@1 without skills under the base harness.
C.3 Verification Over Training
Table 9 reports the mean number of test executions per trajectory over the first ten updates of each epoch. For GRPO and Skill-Mechanism, both trained under , this count falls by 45% and 44%, respectively. Verification therefore also declines without an evolved harness. For Mechanism, which retains in the second epoch, the count falls by 57%. The existing checking tools and reminders do not prevent this observed decline, motivating further harness changes. These are descriptive statistics from one training run per configuration and do not establish the cause of the decline.
C.4 Paired Confidence Intervals
Each configuration is trained once, and each checkpoint is evaluated three times. Following the task-level comparison in Miller [41], we first average the three outcomes for each task and configuration. We then resample tasks with replacement, using the same sampled tasks for both configurations, and recompute their performance difference. Table 10 reports the resulting 95% confidence intervals. Pooled results cover all 1,442 tasks and weight each benchmark by its number of tasks. To compare the two policies' gains from , we first subtract each policy's score from its score, then compare those gains within each resample. The intervals describe variation across tasks for these trained checkpoints and averaged evaluation outcomes. They do not estimate variation from retraining the models.
Re-evolution and reuse. HarnessAdapt-RL exceeds Mechanism by 2.6 percentage points pooled, with a confidence interval of . The individual intervals exclude zero on Multilingual but include zero on Verified and Pro. The pooled gains over GRPO, Skill-Mechanism, and OpenHands-GRPO also exclude zero. Frozen-Mechanism exceeds Mechanism by 2.2 percentage points pooled (), providing additional evidence that the discovered remains useful in a new training run. Frozen-Mechanism and Mechanism have a pooled difference of 0.6 percentage points (). These reuse comparisons change the harness schedule and are not repeated seeds of the same configuration.
| Configuration | Harness | Epoch 1 | Epoch 2 | Relative change |
|---|---|---|---|---|
| GRPO | 2.87 | 1.58 | ||
| Skill-Mechanism | 3.16 | 1.78 | ||
| Mechanism | 2.83 | 1.21 |
Table 9 Mean test executions per training trajectory over the first ten updates of each epoch. The change is relative to the first-epoch mean. Harness denotes the harness used in the second epoch.
| Comparison | Verified | Multilingual | Pro | Pooled |
|---|---|---|---|---|
| Main results | ||||
| HarnessAdapt-RL – GRPO | +9.8 [+6.3, +13.3] | +12.6 [+8.7, +16.6] | +6.4 [+3.7, +9.1] | +8.9 [+7.0, +10.7] |
| HarnessAdapt-RL – +Mechanism | +2.2 [-0.9, +5.3] | +4.6 [+1.3, +7.9] | +2.0 [-0.5, +4.5] | +2.6 [+0.9, +4.3] |
| +Mechanism – Frozen- | +2.2 [-0.8, +5.3] | +1.4 [-2.2, +4.8] | +2.0 [-0.5, +4.6] | +1.9 [+0.2, +3.7] |
| Frozen- – GRPO | +5.4 [+1.9, +8.8] | +6.6 [+2.4, +10.9] | +2.4 [-0.3, +5.2] | +4.3 [+2.3, +6.3] |
| HarnessAdapt-RL – Skill-Mechanism | +5.4 [+2.0, +8.9] | +9.3 [+5.4, +13.2] | +5.1 [+2.2, +8.0] | +6.1 [+4.1, +8.0] |
| HarnessAdapt-RL – OpenHands-GRPO | +6.2 [+2.6, +9.7] | +4.0 [-0.3, +8.3] | +7.4 [+4.6, +10.2] | +6.3 [+4.3, +8.2] |
| OpenHands-GRPO – GRPO | +3.6 [+0.3, +6.9] | +8.6 [+4.6, +12.7] | -1.0 [-3.9, +1.9] | +2.6 [+0.7, +4.6] |
| Frozen- – OpenHands-GRPO | +1.8 [-1.5, +5.1] | -2.0 [-6.3, +2.3] | +3.4 [+0.5, +6.2] | +1.7 [-0.2, +3.7] |
| Skill variants and coverage | ||||
| Skill-Mechanism – GRPO | +4.4 [+1.1, +7.7] | +3.3 [-0.1, +7.0] | +1.3 [-1.6, +4.2] | +2.8 [+1.0, +4.6] |
| Skill-Hint – GRPO | -2.4 [-5.3, +0.6] | -2.4 [-6.1, +1.4] | -2.9 [-5.6, -0.2] | -2.6 [-4.4, -0.8] |
| Skill-Bank – GRPO | +0.4 [-2.9, +3.7] | -4.4 [-7.8, -1.0] | +0.5 [-2.4, +3.3] | -0.6 [-2.4, +1.3] |
| Skill-Mechanism – Skill-Hint | +6.8 [+3.8, +9.9] | +5.7 [+2.5, +9.0] | +4.2 [+1.6, +6.9] | +5.4 [+3.7, +7.2] |
| Skill-Mechanism – Skill-Bank | +4.0 [+1.0, +7.1] | +7.7 [+4.4, +11.0] | +0.8 [-1.8, +3.3] | +3.3 [+1.6, +5.1] |
| Skill-Gated – Skill-Mechanism | -5.0 [-8.0, -2.1] | - | - | - |
| Skill-Gated – GRPO | -0.6 [-3.7, +2.5] | - | - | - |
| Harness diagnostics (Section 4.5) | ||||
| HarnessAdapt-RL – Skill-Mechanism, both under | +0.6 [-2.3, +3.6] | +1.6 [-1.7, +4.9] | +0.4 [-2.0, +2.8] | +0.7 [-0.9, +2.3] |
| HarnessAdapt-RL – Skill-Mechanism, both under | +3.4 [+0.3, +6.4] | +4.0 [-0.2, +8.2] | +2.8 [+0.1, +5.5] | +3.3 [+1.4, +5.1] |
| Skill-Mechanism: | +2.0 [+0.2, +3.8] | +5.3 [+2.7, +7.9] | +2.3 [+0.7, +4.0] | +2.8 [+1.7, +3.9] |
| HarnessAdapt-RL: | +4.8 [+2.7, +6.9] | +7.7 [+5.4, +10.1] | +4.7 [+2.9, +6.5] | +5.4 [+4.2, +6.6] |
| Gain from : HarnessAdapt-RL – Skill-Mechanism | +2.8 [-0.1, +5.6] | +2.4 [-0.7, +5.6] | +2.4 [+0.01, +4.8] | +2.5 [+1.0, +4.2] |
| Frozen harnesses (Section 4.6 and Appendix C.6) | ||||
| Frozen-+Mechanism – HarnessAdapt-RL | -0.8 [-4.0, +2.4] | +1.0 [-2.4, +4.4] | -0.8 [-3.5, +2.0] | -0.4 [-2.2, +1.4] |
| Frozen-+Mechanism – +Mechanism | +1.4 [-1.6, +4.3] | +5.6 [+2.2, +9.2] | +1.2 [-1.5, +3.9] | +2.2 [+0.4, +3.9] |
| Frozen-+Mechanism – +Mechanism | 0.0 [-3.1, +3.1] | +1.0 [-2.3, +4.3] | +0.9 [-1.6, +3.4] | +0.6 [-1.1, +2.3] |
| Frozen-+Mechanism – Frozen- | +2.2 [-0.9, +5.3] | +2.4 [-1.6, +6.5] | +2.9 [+0.2, +5.7] | +2.6 [+0.7, +4.4] |
Table 10 Paired differences in pass@1 (percentage points) with 95% bootstrap confidence intervals in brackets. Pooled results weight each benchmark by its number of tasks. Skill-Gated is evaluated only on Verified. Rows marked or are evaluated without skills under that harness. All other rows use each configuration's deployment harness.
C.5 Guidance Coverage and Learning Curves
Figure 2 in Section 4.3 compares the three forms of guidance. Figure 7 compares guidance coverage. Skill-Gated provides a skill only when all attempts collected before skill generation fail. Skill-Mechanism also provides skills to tasks with successful attempts. Skill-Mechanism and Skill-Gated share the mechanism-level skill prompt, base harness, training schedule, and evaluation protocol. They differ in guidance coverage and in the trajectories used to generate guidance.
Skill-Gated ends at 47.2% on Verified, close to GRPO's 47.8% and below Skill-Mechanism's 52.2%. Training pass rates in Figure 7 are measured on the training rollouts collected after guidance assignment, not on the preparation attempts used for gating.
Skill-Gated invokes the teacher on fewer tasks, and because no successful trajectory is available when it does, each skill is generated from two failures. Skill-Mechanism instead prefers a success-failure pair (Appendix A.2). The comparison therefore cannot separate how often guidance is provided from the evidence used to generate it. Isolating these factors would require a control that applies failure-only generation to all assisted tasks.
- □ - GRPO - Skill-Mechanism - △ - Skill-Gated
a Training

b SWE-bench Verified (base harness)

Figure 7 Broad and failure-gated mechanism-level guidance. (a) Rollout pass rate during training. Faint lines show individual updates and bold lines show five-update trailing means. (b) Verified pass@1 without skills under the base harness. Dashed lines mark the boundary between the two training epochs.
C.6 Fixing the First-epoch Harness
Table 11 reports the Frozen- reference configuration. Frozen- reuses from the first epoch of HarnessAdapt-RL and trains the base model with fixed throughout both epochs, without skills. It exceeds GRPO by 5.4, 6.6, and 2.4 percentage points on Verified, Multilingual, and Pro, respectively.
Section 4.6 trains with from the first update. We run the same test for . Frozen-+Mechanism trains with from the start, using mechanism-level guidance on the same task schedule as HarnessAdapt-RL. Figure 8 compares it with Frozen-, which uses without skills, and with +Mechanism, which evolves during the first epoch and keeps it in the second.
Frozen-+Mechanism reaches 55.4%, 33.7%, and 38.6% on Verified, Multilingual, and Pro, almost the same as +Mechanism. Once discovered, can therefore be reused from the start of a new run with similar observed scores. This comparison tests reuse of an existing harness, not whether the same harness would be discovered before policy training. Skills also add gains on top of this harness: adding mechanism-level skills raises Frozen- by 2.2, 2.4, and 2.9 percentage points.
| Configuration | Verified | Multi. | Pro | Avg. |
|---|---|---|---|---|
| Frozen- | 53.2 | 31.3 | 35.7 | 40.1 |
Table 11 Pass@1 (%) for Frozen- without skills. Avg. is the unweighted mean over the three benchmarks.

Figure 8 Pass@1 (%) without skills at evaluation. All three configurations use , either fixed from the start of training (Frozen- and Frozen-+Mechanism) or evolved during the first epoch (+Mechanism).
| Component | Inputs / trigger | Behavior |
|---|---|---|
| Tools | ||
| read_file | File path and optional line window | Read a bounded text window with line numbers and a continuation position for further reading. |
| grep | Search pattern, path, and optional filters | Return bounded matches with paths and line numbers. Mark incomplete searches or outputs. |
| edit_file | File path, old text, and replacement text | Replace one unique text match and return a short diff. Leave the file unchanged if there are zero or multiple matches. |
| write_file | New file path and content | Create a source file or temporary reproduction script without overwriting an existing file. New source files must be explicitly included in the patch. |
| view_diff | Selected files and optional page limits | Inspect current additions, modifications, and deletions with read-only pagination. Do not create a patch file. |
| run_check | Check command and optional timeout | Run a focused check, preserve its exit status and full log, and return a short diagnostic. |
| prepare_patch | Selected source files | Write their actual diff to patch.txt, check reverse applicability to the current working tree, and return a bounded preview. Do not run behavioral tests or submit the patch. |
| Runtime hooks | ||
| budget_submission | Remaining turns or context enter a tighter budget tier | Prompt the policy to narrow its investigation and reserve time for a focused check, patch preparation, and explicit submission. |
| progress_guard | Identical calls, exit codes, and outputs recur across turns | Suggest a different observation or a corrected call. Successful edits or patch preparation reset the repetition history. |
| validation_feedback | Check failure, runner issue, timeout, or patch preparation | Report check or preparation problems. On the first successful preparation, flag missing checks after the latest tracked edit or unresolved failures. |
| semantic_review | First successful patch preparation | Prompt one review of the task requirements, executed checks, preserved behavior, and unresolved evidence. Adapt the reminder to the remaining budget. |
Table 12 Components of the first-epoch harness : seven tools and four runtime hooks, in addition to native Bash. Tool inputs are summarized rather than listed as complete schemas.
C.7 Training and Deployment Costs
We count rollouts over the full 46-update training schedule, including the final update after the reported update-45 checkpoint, using the settings in Appendices B.1 and B.3. Table 13 summarizes the totals. All skill configurations collect 8,464 training rollouts. Skill-Hint, Skill-Mechanism, Skill-Bank, and HarnessAdapt-RL also collect preparation rollouts for every assisted task: 4,232 in the first epoch and 2,048 in the second. HarnessAdapt-RL makes five candidate comparisons in the first epoch and four in the second. With 184 rollouts per side, the nine comparisons collect rollouts. GRPO collects 16,928 training rollouts and nothing else. HarnessAdapt-RL therefore uses
| Configuration | Train | Prep. | Comp. | Total |
|---|---|---|---|---|
| GRPO | 16,928 | 0 | 0 | 16,928 |
| Frozen- | 8,464 | 0 | 0 | 8,464 |
| Skill-Hint / Skill-Mechanism / Skill-Bank | 8,464 | 6,280 | 0 | 14,744 |
| HarnessAdapt-RL | 8,464 | 6,280 | 3,312 | 18,056 |
Table 13 Rollouts collected over the full training schedule. Comparison counts cover nine candidate comparisons across both epochs. The final second-epoch round has no candidate and collects no comparison rollouts.
18,056 rollouts in total, of which 8,464 are collected for policy updates.
The Frozen- row counts training with an already discovered harness and excludes its original discovery cost. Rollout counts do not directly measure compute, because trajectory lengths differ across configurations (Appendix C.2). Teacher cost is separate from rollouts. For near-answer hints and mechanism-level skills, the schedule requires 1,570 initial skill-generation requests over the two epochs, before any regeneration. Skill-Gated requests skills only for tasks whose preparation attempts all fail. Skill-Bank also updates its skill bank from task reports (Appendix A.2). Harness evolution adds ten teacher invocations, one per round across both epochs. Each invocation covers diagnosis and, when a change is proposed, its design and implementation. These invocation counts are separate from the rollout totals and do not measure teacher token usage.
At deployment, the policy runs without skills, teacher calls, or harness search. The only added cost comes from the retained tools and hooks. Tools execute bounded commands in place of the equivalent Bash sequences, and hooks inject short messages at specific runtime states without executing commands.
C.8 Harness Evolution Record
Comparison protocol and reporting. Each epoch allows at most five harness-evolution rounds, starting from in epoch 1 and in epoch 2. In each comparison, the candidate and current harness use the same policy checkpoint, 46-task batch, skills, and rollout budget. Each side generates four rollouts per task, for 184 rollouts. The two rates use all sampled rollouts as the denominator, with trainability defined in Appendix B.2. After selection, fresh training rollouts are collected under the retained harness for the policy update. Comparison rollouts are not reused for training.
Figure 3 and Table 15 report relative percentage changes. Numerical summaries are rounded to one decimal place. For either rate r, the change is
Each value compares the candidate with the current harness evaluated in that round, rather than with a historical score. The changes are not percentage-point differences and should not be added across rounds. A candidate is accepted if neither rate decreases and at least one increases. A rejected candidate leaves the current harness unchanged. A round without a candidate has no rate comparison.
First-epoch progression. Rounds 1, 2, and 5 are accepted. Round 1 adds reading, search, editing, file creation, and checking tools. Round 2 adds patch preparation and hooks for budget use, repeated actions, and validation. Batched inspection in round 3 lowers the pass rate, while the review proposal in round 4 lowers the trainable rate, so both are rejected. Round 5 accepts review together with diff inspection. The accepted candidates raise the pass rate by 5.6%–13.7% and the trainable rate by 7.4%–7.8% relative to the current harness in each round. The resulting has seven tools and four hooks (Table 12) and is retained for the rest of the epoch. Frozen- and +Mechanism also use this harness.
Second-epoch evolution. already provides checking tools and reminders, but later trajectories show less frequent testing (Appendix C.3). The first three second-epoch proposals are accepted. They add tests during patch preparation and verification summaries, preserve focused testing in budget reminders, and provide file recovery (Table 14). Their relative gains are 3.5%–6.3% in pass rate and 3.2%–7.4% in trainable rate. Round 4 requests an additional policy-run test when automatic selection provides no verification evidence. It is rejected because the pass rate falls by 2.3% despite a 1.6% trainable-rate gain. Round 5 produces no candidate. The retained has eight tools and five hooks and is used for subsequent training and evaluation. Its six original tools other than prepare_patch, and its progress_guard hook, are unchanged. Across both epochs, six of nine candidates are accepted. The comparisons assess complete bundles, not individual component effects.
| Component | Change | Behavior in |
| Tools | ||
| prepare_patch | Modified | Retain patch generation and structural checks. Also select and run related existing tests within a time budget, report their results, and flag large deletions. |
| restore_file | Added | Restore one tracked file from the unchanged Git index. Discard that file's current edits while leaving other files unchanged. |
| Runtime hooks | ||
| delivery_evidence | Replacement | Replace semantic_review. After successful patch preparation, summarize checks since the latest tracked edit, related test results, and large deletions. Suggest a next step based on the evidence and remaining budget. |
| recovery_hint | Added | When a Git recovery or comparison command is blocked, suggest the available restore or diff tools and explain how to preserve edits when needed. |
| validation_feedback | Modified | Keep check-failure and preparation-failure feedback. Transfer the validation summary after successful preparation to delivery_evidence. |
| budget_submission | Modified | Clarify that focused existing tests remain useful while discouraging repeated full-suite runs. Keep the budget thresholds and later reminders unchanged. |
Table 14 Changes from to the second-epoch harness , which contains eight tools and five runtime hooks in addition to native Bash. Unlisted components are unchanged. Accompanying harness instructions are described in the text.
| Epoch | Round | Candidate change | Relative change (%) | Decision | |
|---|---|---|---|---|---|
| Pass rate | Trainable rate | ||||
| 1 | 1 | Add read_file, edit_file, write_file, grep, and run_check. | +13.7% | +7.4% | Accept |
| 1 | 2 | Add budget_submission, prepare_patch, progress_guard, and validation_feedback. | +5.6% | +7.4% | Accept |
| 1 | 3 | Add inspect_windows and inspection_checkpoint. | -5.1% | +0.8% | Reject |
| 1 | 4 | Add semantic_review and accompanying guidance. | +2.7% | -7.0% | Reject |
| 1 | 5 | Add semantic_review and view_diff. | +6.6% | +7.8% | Accept |
| 2 | 1 | Run related tests in prepare_patch, replace semantic_review with delivery_evidence, and adjust validation_feedback. | +6.3% | +7.4% | Accept |
| 2 | 2 | Revise budget_submission to preserve focused testing. | +3.5% | +3.9% | Accept |
| 2 | 3 | Add restore_file, recovery_hint, and recovery guidance. | +3.9% | +3.2% | Accept |
| 2 | 4 | Revise prepare_patch guidance to request an additional policy-run test when automatic test selection yields no verification evidence. | -2.3% | +1.6% | Reject |
| 2 | 5 | No new harness change proposed. | — | — | No proposal |
Table 15 Harness proposals and relative rate changes against the current harness in the same round. Values are rounded to one decimal place. Each comparison uses 184 rollouts per side. A dash indicates that no candidate was proposed and no comparison was run. Changes are not cumulative.
Rejected proposals. The batched-reading tool inspect_windows combines two to four source windows in one call. The policy supplies each file, line offset, and window length, so the tool does not locate relevant code automatically. The accompanying inspection_checkpoint hook asks the policy to summarize its current hypothesis and an unresolved observation after five consecutive successful reading or search steps. Other actions reset this sequence. The tool therefore combines planned reads without choosing where the policy should look next.
The first-epoch review proposal asks the policy to compare the repair against task requirements and identify gaps in its checks. That candidate fails the acceptance rule, while a later candidate combining review with diff inspection is accepted. In the second epoch, the rejected patch-preparation rule explicitly requests another policy-run test when automatic test selection supplies no verification evidence. The retained delivery_evidence hook instead bases its suggestions on the observed checks and remaining budget. Further policy-run checks remain available through run_check. Table 15 gives all proposal outcomes.
First-epoch tool limits. read_file returns 60 lines by default and at most 200. grep returns up to 60 matching lines by default and at most 100. view_diff shows 120 lines per page by default and at most 200. Reading and diff outputs also have character limits. run_check allows at most 45 seconds, preserves pipeline failures, and reports runner problems, zero-test signals, and timeouts. A zero exit code alone does not establish that the task requirements were tested. In , prepare_patch checks patch structure without running behavioral tests. Further edits require patch regeneration.
First-epoch hook triggers. The three budget tiers begin at 30, 12, and 5 remaining turns, or 24,576, 12,288, and 6,144 remaining context tokens, respectively. Reminders occur only on entry to a tighter tier, while turns remain. progress_guard requires identical calls and results in three different turns within a 12-turn window. It gives at most two reminders, once per signature. validation_feedback allows two check-failure reminders, one preparation-failure reminder, and one validation summary after successful preparation. semantic_review runs once. Shell-check recognition is heuristic, so missing records do not prove that no check occurred.
Tests during patch preparation. In , prepare_patch keeps the same file-selection interface. After preparing the patch, it ranks tracked Python test files using the changed paths and diff, excluding setup files, runners, and edited files. Matching filenames add three points and matching parent directories add one point per changed file. A textual reference to an extracted function or class name adds two points per candidate test file. Names come from diff hunk headers and added or removed definitions. The tool retains up to eight distinct names longer than three characters, excluding names beginning with two underscores. It keeps the top five tests scoring at least two, breaking ties by shorter paths and then alphabetical order.
It runs up to two selected test files or modules within 25 seconds, using tests/runtests.py, pytest, or bin/test, depending on the repository. Returned evidence includes the command, status, exit code, failure summary, elapsed time, and log location. Results are cached by patch content, working directory, and command, with reuse explicitly marked. Selection provides partial verification evidence, not guaranteed coverage or the official task score. The policy can run additional checks through run_check.
Patch preparation and tests have separate statuses. Preparation can return ok: true while tests fail, time out, or cannot run. The policy reads related_test_run for the test outcome. The tool also reports line changes and flags files with at least 100 deletions and at least twice as many deletions as additions. This prompts inspection without declaring the change incorrect.
Validation feedback. delivery_evidence replaces semantic_review. It tracks editing, file creation, restoration, and shell source changes recognized from command patterns. A tracked non-temporary source edit resets the check list. Records distinguish tests, assertion-based scripts, and print-only scripts. After successful preparation, the hook summarizes these records, related test results, large deletions, and remaining budget. It suggests inspecting failures, adding a focused check, or submitting, according to the evidence and budget. At most three summaries are emitted, with a newly tracked edit required after the first. The summary covers observed events, not every possible edit or check. validation_feedback retains failure feedback but delegates the preparation summary to this hook.
File recovery. restore_file restores one tracked regular file from the Git index, which the task rules prohibit the policy from changing. It discards that file's edits and can recreate a deleted file. Other files, the index, and patch.txt remain unchanged, so recovery requires patch regeneration. Untracked files, directories, symbolic links, and conflicted entries are rejected. After a blocked Git recovery or comparison command, recovery_hint suggests restoration, diff inspection, or preserving edits before restoration, as appropriate. It emits at most two reminders.
Accompanying harness instructions. explains automatic tests, failure handling, file recovery, and the limits of print-only checks. It directs existing-file edits through edit_file and preserves focused testing while discouraging repeated full-suite runs. These general harness instructions remain at evaluation, unlike temporary task-specific skills. The system prompt is unchanged.
Runtime and submission. Hooks add feedback without teacher calls, repair commands, or submission blocking. Automatic tests run inside prepare_patch. Submission remains a separate native Bash action (Appendix A.3).
D Prompts and Teacher Outputs
This appendix documents the teacher prompts and representative outputs. Placeholders in double braces are filled in at run time. Prompts are reproduced as full-width figures, with long instructions split between complete paragraphs or list items. All prompt text is preserved.
D.1 Skill Generation Prompts
The prompts below correspond to the guidance variants in Appendix A.2.
Near-answer hints and mechanism-level skills use evidence from a single task. The skill bank combines evidence across tasks.
Figures 9–15 reproduce the instructions and input templates.
D.2 Representative Teacher Outputs
Figure 16 shows one representative output for each guidance type.
Near-answer hints specify code changes. Mechanism-level skills explain the repair mechanism without code identifiers. Skill-bank guidance describes procedures shared across tasks.
For mechanism-level skills, only the Task-specific Skill section is injected into the policy context.
D.3 Harness Proposal and Implementation Prompt
The teacher diagnoses problems, designs a candidate, and implements it in one call (Appendix B.2).
Figures 17–21 reproduce the complete instruction, with the input template in the final part.

Figure 9 Teacher instruction and input template for Skill-Hint.

Figure 10 Teacher instruction for Skill-Mechanism. Part 1 of 5.
Skill-Mechanism: repair mechanism (2/5)
-
This input covers one task, so it cannot prove cross-task recurrence. Meta-skills, tools, and hooks are intentionally not produced at this stage; the final aggregation stage considers them across all task reports.
-
Always produce one task-specific skill. When the success/failure contrast is only about delivery or budget, derive the skill conservatively from the issue and any validated technical strategy visible in the rollouts; do not turn a delivery difference into the task-specific skill.
-
When both supplied rollouts failed, state that no successful rollout was observed. Treat the more converged failure only as partial progress. Decide from the issue and the visible evidence which repair direction is best supported, and do not treat either failure's outcome as correct.
-
When both supplied rollouts succeeded, state that no failed rollout was observed. Use
no_systematic_differenceunless the evidence supports a more specific contrast; describe shared successful behavior and any actual tool-use shortcomings. Do not invent a failed run. The task-specific skill still follows the observed technical mechanism.
Category definitions and boundaries
1. Success/failure comparison
First state the contrast that grounds every later output. The comparison is an evidence summary, not a skill, and may contain task-specific names. It has four fields:
-
failure_mode: one ofwrong_patch,never_localized,test_thrashing,edited_but_unsubmitted,no_systematic_difference, orother; -
success_behavior: the decisive diagnosis, action, evidence use, validation, and delivery behavior visible in successful rollouts; -
failure_behavior: the wrong path, missed signal, unsupported assumption, bad edit, non-convergence, or delivery failure visible in failed rollouts; -
decisive_difference: one concise causal statement of what the success got right that the failure got wrong or omitted.
Do not merely say that one received reward and the other did not. If a failed rollout produced no final patch, do not invent an incorrect patch; contrast how the successful rollout converged with the visible reason the failure did not. Use no_systematic_difference when the pair does not support a causal contrast. For a failure-only pair, write explicitly that no successful rollout was observed, summarize the stronger partial progress under success_behavior, and contrast the two failure paths under the remaining fields.
Figure 11 Teacher instruction for Skill-Mechanism. Part 2 of 5.
Skill-Mechanism: repair mechanism (3/5)
2. Tool-use problems
Identify shortcomings in how the model used tools and capabilities already available in either the successful or failed trajectory. A successful rollout may still expose tool-use problems; success does not erase inefficient, incorrect, or risky tool behavior. This section is strictly about tool interaction, not a general critique of reasoning style or task planning. Its findings are evidence for the final aggregation stage, not proposals for new tools or hooks.
Each problem has exactly four labeled fields:
Applies when: the observable tool-use situation that triggers the lesson;Wrong tool use: the concrete misuse, inefficient use, risky use, misinterpretation, or omitted necessary invocation;Better tool use: the bounded way to use the same existing capability more reliably; do not propose a new capability;Evidence: the bounded event sequence supporting it, explicitly identifying whether it occurred in the successful rollout, failed rollout, or both.
Keep each field concise. Each of the four field values may contain one or two sentences.
Check tool selection, command or argument correctness, target and output scope, handling of truncation or errors, interpretation of observations, adaptation of the next call, redundant calls, sequencing, validation use, and omission of a required tool action. Output only shortcomings, whether they occur in a successful rollout, a failed rollout, or both.
Do not place faulty hypotheses, excessive curiosity, weak time management, or other general problem-solving issues here unless they manifest as a concrete tool invocation, interpretation error, inefficient tool sequence, or omitted required call. Do not label a call problematic merely because it appears in a failed run, and do not suppress a real problem merely because the rollout succeeded. Do not prescribe a new capability. Include only the two most severe problems, ranked by causal importance and observed harm. Emit fewer than two when the evidence supports fewer; never add a minor issue merely to fill the count. Write None when no concrete tool-use shortcoming is supported.
Figure 12 Teacher instruction for Skill-Mechanism. Part 3 of 5.
Skill-Mechanism: repair mechanism (4/5)
3. Task-specific skill
task_specific_skill is the one technical skill generated for this task. Identify the concrete wrong-versus-right lesson from the issue and the rollouts' useful evidence; then express that lesson at a reusable medium level. Preserve technical mechanisms needed to make the skill useful, such as data-structure invariants, ordering behavior, state transitions, normalization, parsing, dispatch, serialization, decoding, lifecycle, and validation boundaries. Remove answer-locating details: repository and package names, paths and file names, exact API or code-symbol names, literal code, exact edit locations, and diff text.
Do not derive this skill mechanically from a rollout's final outcome. If the rollouts differ only in packaging, submission, or budget use, ignore that delivery difference here and extract the technical strategy grounded in the issue and the rollouts' technical evidence. Delivery shortcomings belong only in Tool-Use Problems.
Write one compact reusable skill, retaining exactly these three labeled fields:
-
Applies when: the transferable technical condition that triggers the skill; -
Wrong approach: the tempting but unreliable approach; -
Better approach: the bounded contrasting strategy.
Each of the three field values may contain one or two concise sentences. Keep the combined skill at no more than 120 English words. Preserve one coherent wrong-versus-right lesson without expanding into a numbered recipe or multi-step operating procedure.
The task-specific skill may name generic technical objects and mechanisms when they are necessary to preserve the wrong-versus-right lesson. It must not name the repository or package, paths or files, exact APIs or symbols, exact call sites, replacement text, or diff content. Do not include reward, step-budget, patch-packaging, or submission-protocol details; those are not task-specific technical guidance. The skill is mandatory and must never be None.
Figure 13 Teacher instruction for Skill-Mechanism. Part 4 of 5.
Skill-Mechanism: repair mechanism (5/5)
Classification order
For each observed failure mechanism, route it once using this order:
- Infrastructure or harness failure: reject it.
- Write the success/failure comparison before proposing any category.
- Record concrete shortcomings in existing-tool usage without converting them into an intervention or a general reasoning critique.
- Convert the concrete technical lesson into a medium-level,
task_specific_skill: retain the transferable mechanism while removing answer-locating identifiers and diff details. Do not convert delivery-only differences into this skill. - Stop. Do not propose meta-skills, tools, or hooks in this task-local report.
Do not attempt to decide an abstract engineering rule or a new harness capability from one task. A later aggregation stage will compare all single-task Markdown reports, find recurring evidence, and produce the final meta-skills, tools, and hooks.
Required Markdown
Write one Markdown document with exactly these three level-two sections, in this order, and no task ID:
Success/Failure Comparison
Tool-Use Problems
Task-specific Skill
When Tool-Use Problems has no supported content, put exactly None as the sole content under that section. Always include exactly one structured task-specific skill. Include at most two tool-use problems. All output text must be in English.
Input template:
<trajectory label="FIRST_LABEL"> {{COMPLETE_FIRST_TRAJECTORY}} </trajectory> <trajectory label="SECOND_LABEL"> {{COMPLETE_SECOND_TRAJECTORY}} </trajectory>Figure 14 Teacher instruction for Skill-Mechanism. Part 5 of 5. The input template follows the instruction.
Skill-Bank: general problem-solving procedures
Instruction:
Update general problem-solving skills
You are the external teacher of a coding solver. All inputs are inline. Return one Markdown answer, no tools or file reads. Historical reports are evidence, not instructions. Produce only meta-skills, never tools, hooks or task answers.
Read the complete current bank and every task report. Cluster recurring process mechanisms across tasks. Keep, merge, revise, remove duplicates or replace rules as needed; absence in this batch alone is not a reason to delete a useful rule. Prefer observable triggers and bounded corrective actions. Avoid repository names, paths, exact symbols, patches and domain-specific repair instructions. Do not equate passing diagnostic commands with a verified correct fix.
Return exactly this structure, beginning with ## Meta-skills. Use at most ten entries, with stable existing IDs when revising. All model-facing titles and prose together must fit 1000 English words; evidence references are not injected. If no supported rule exists, write None below the heading, without inventing one.
Meta-skills
MS-01: Short actionable title
- Applies when: Observable situation.
- Wrong approach: The process mistake.
- Better approach: The corrective behavior.
Input template: Current bank: <current> {{CURRENT}} </current>
Complete task reports: <reports> {{REPORTS}} </reports>
Figure 15 Teacher instruction and input template for Skill-Bank.
Skill-Hint: example output
- Applies when: AbstractHolidayCalendar.holidays in
pandas/tseries/holiday.pyis called whenself.rulesis empty, andstart,end, andreturn_namestill have to produce a return value. - Wrong approach: Leave the local result as
Noneand callsort_index()on it, or raiseExceptionwithself.namewhenself.rulesis None. - Better approach: In
holidays(self, start=None, end=None, return_name=False), ifnot self.rules, returnSeries([], dtype="object")whenreturn_nameis true andDatetimeIndex([]otherwise, beforestartandendare used.
Skill-Mechanism: example task-specific skill
- Applies when: *Substituting type variables into a composite generic alias where a nested parameter (e.g., a union) itself carries multiple type variables.
- Wrong approach: *Substituting the nested parameterized object with a single consumed parameter; it re-indexes the nested type with one argument and raises a "too few parameters" error whenever the nested type expects more.
- Better approach: *In the recursive substitution, when a parameter exposes type variables, consume exactly as many parameters as that nested object declares and apply them as a tuple; also route nested standard-library generic aliases through the same recursion rather than only recognizing the local alias class.
Skill-Bank: example general procedure
MS-01: Reserve budget for the delivery sequence
- Applies when: *A validated fix exists in the working tree and the task requires an explicit prepare -> inspect -> submit sequence under a finite turn budget.
- Wrong approach: *Continuing exploratory probes, extra test suites, or edge-case sweeps after validation until the limit hits, ending with no submission.
- Better approach: *Once the reproducer and focused tests pass, immediately prepare the patch, inspect it once, and submit in a separate action; defer optional exploration until after submission.
Figure 16 Representative teacher outputs for Skill-Hint, Skill-Mechanism, and Skill-Bank.
Harness proposal and implementation (1/5)
Instruction:
You are a harness-design agent. Analyze the current agent harness and its execution trajectories, identify the most consequential supported limitation, and implement a concrete improvement.
Derive the design from observed behavior and the current implementation. Do not assume a desired final architecture or a predetermined list of components.
Optimization objective
Improve both task-solving performance and the yield of rollouts usable for policy-gradient training.
Use these definitions:
-
Pass rate: the number of sampled rollouts that pass the task evaluator, divided by the total number of sampled rollouts.
-
Trainable rollout ratio: the number of sampled rollouts retained by the actual training postprocessing with a nonzero policy-loss token mask, divided by the total number of sampled rollouts.
A submission, a successful command, and a claim of completion do not establish a task pass. Task success or submission status alone does not establish training eligibility. Use the recorded evaluator outcomes and actual postprocessing rules and masks; when these are unavailable, state the uncertainty.
Relative to the current harness in a comparable comparison, the design objective is:
pass_rate(candidate) >= pass_rate(current)
trainable_rollout_ratio(candidate) >= trainable_rollout_ratio(current)
At least one inequality must be strict. Improvement in one objective does not compensate for degradation in the other.
If the training pipeline excludes groups with identical rewards, both all-success and all-failure groups may be excluded from policy loss. Account for this interaction when reasoning about the two objectives. Do not manufacture failures, weaken task requirements, or change reward and masking definitions to increase training eligibility.
Treat proposed effects as predictions until supported by measured results.
- Reconstruct the behavior that needs support
Read the current harness alongside the trajectories. Inspect what its tools actually do, what observations they return, what events activate its hooks, and what its instructions ask the agent to do.
For representative episodes, reconstruct a concise sequence of:
-
The relevant task requirement and observable state.
-
Information available to the agent at the decision point.
-
The action selected and the observation it produced.
-
Subsequent progress, repeated work, unresolved uncertainty, or loss of useful state.
-
Remaining interaction and context budget.
-
Termination, evaluator outcome, and training eligibility when recorded.
Figure 17 Teacher instruction for tool and hook proposals and implementation. Part 1 of 5.
Harness proposal and implementation (2/5)
Locate the earliest actionable point where different harness support could plausibly have changed the subsequent behavior.
Use summaries and automatic labels to locate episodes, then verify important claims against the underlying tool calls, outputs, and state changes. A missing detector match is not proof that an action never occurred. A repeated call may be justified by an intervening change. A successful command may provide little evidence about the requested behavior.
When reporting recurrence or usage, distinguish calls from trajectories, and report the relevant denominator. Separate how often a mechanism could have helped, how often it was available, and how often the agent actually used it. Neither frequent use nor rare use establishes effectiveness.
Compare failures with successful or otherwise informative episodes facing similar conditions. Include counterexamples that weaken the proposed explanation. Do not select only traces that support your preferred design.
- Diagnose the limitation of the current harness
For each important pattern, distinguish:
-
Observation: what the recorded trajectory directly establishes.
-
Mechanism hypothesis: how the harness may have contributed to the behavior.
-
Alternative explanations: other causes consistent with the evidence.
-
Uncertainty: information that is missing or ambiguous.
Determine whether the problem concerns:
-
A capability the agent does not have.
-
An existing capability whose interface is difficult to use.
-
Observations that are incomplete, excessive, ambiguous, or stale.
-
A capability that is available but selected at the wrong time or not used.
-
Feedback that is misunderstood or does not support the next decision.
-
Coordination between operations, state changes, and limited resources.
These are diagnostic possibilities, not required additions.
Identify which part of the current implementation supports the diagnosis. Do not describe an existing capability as absent merely because it was ineffective in some trajectories.
Separate task failure from exclusion from training. Where metadata permits, identify whether training exclusion follows from invalid or incomplete interaction, postprocessing constraints, group-level reward equality, or another recorded condition. Do not infer the reason from the final reward alone.
Prioritize limitations using recurrence, consequence, avoidable interaction cost, evidence strength, and whether the harness can plausibly affect the behavior. A difficult task or a reasoning error does not automatically imply a missing tool.
When policy versions differ, revisit earlier diagnoses using the current policy-harness trajectories. Treat earlier findings as hypotheses to reconsider, not as established limitations of the current system.
Figure 18 Teacher instruction for tool and hook proposals and implementation. Part 2 of 5.
Harness proposal and implementation (3/5)
- Select the appropriate form of improvement
Choose one supported limitation and propose a small, coherent improvement.
Classify every change explicitly:
-
Tool change: adds or changes a callable operation, its inputs, action semantics, or returned observations.
-
Hook change: adds or changes an intervention triggered by an event and possibly conditioned on retained state.
-
Guidance change: changes instructions about selecting, sequencing, or interpreting capabilities.
-
Other harness change: specify the affected representation or control mechanism precisely.
Mark each component as added, modified, replaced, or reused.
Distinguish an instruction to perform an action from code that automatically performs or enforces that action. Do not describe guidance as a new tool, or advisory feedback as a mandatory gate.
Consider whether an existing capability can be clarified or adapted before adding another one. Choose the implementation layer that addresses the observed limitation.
A proposal may contain multiple cooperating changes when necessary. For each component, explain:
-
The observed problem it addresses.
-
What it changes at the relevant decision point.
-
Which other components it depends on.
-
Why the proposed combination is needed.
-
What unnecessary changes have been excluded.
Prefer the smallest coherent mechanism, rather than an arbitrary number of components. Do not bundle unrelated improvements under a broad rationale.
Treat historical outcomes at the scope actually measured. A rejected bundle does not establish that every component is harmful. An accepted bundle does not isolate the benefit of one component. Do not combine results from different policies, task cohorts, or parent configurations into a cumulative improvement claim.
Figure 19 Teacher instruction for tool and hook proposals and implementation. Part 3 of 5.
Harness proposal and implementation (4/5)
- Specify the behavioral mechanism and its costs
Explain the expected chain:
observed situation
→ new capability or information
→ changed agent decision or action
→ possible effect on task success and training eligibility
Identify the intended behavioral change and the observations that would weaken your hypothesis.
Consider whether the agent can discover and use the mechanism with the information available at that point. Account for argument preparation, interpretation of feedback, and any extra decisions imposed by the interface.
Describe plausible costs and adverse effects, including additional calls, tokens, execution time, state complexity, interruption, misleading heuristics, or disruption of useful behavior.
Specify when the mechanism should remain inactive, stop repeating, or defer to the agent. Explain how it preserves useful behavior demonstrated by the counterexamples.
If the design produces evidence, state exactly what that evidence establishes. Distinguish an attempted operation from a completed one, structural validity from task correctness, partial checks from comprehensive coverage, and cached observations from fresh execution.
Explain the expected effect on each objective separately. Do not use shorter trajectories, more tool calls, more checks, or more submissions as substitutes for pass rate and trainable rollout ratio.
- Implement the candidate
Produce concrete code or exact edits using the harness's existing extension points and conventions.
For each tool change, specify:
-
Inputs and constraints.
-
Actual operations and side effects.
-
Returned observations and their meaning.
-
Failure behavior and resource bounds.
Figure 20 Teacher instruction for tool and hook proposals and implementation. Part 4 of 5.
Harness proposal and implementation (5/5)
For each hook change, specify:
- Triggering events and conditions.
- State that is read or retained.
- Feedback or automatic action.
- Repetition limits and reset conditions.
- Conditions under which it remains silent.
For each guidance change, provide the exact instruction text and its integration point. Explain which existing or modified capability it refers to.
Keep the design general across tasks. Do not encode task identifiers, reference solutions, expected answers, hard-coded project paths, or exceptions tailored to individual examples. Use trajectories as evidence for the design, not as solutions to embed in it.
Preserve the task's permissions, evaluator semantics, and training eligibility rules. Make no claims that an action was performed, a test passed, or a behavior improved unless the available evidence establishes it.
Response structure
A. Evidence and diagnosis
Present the prioritized limitation, concrete trajectory and event references, recurrence with denominators where available, successful counterexamples, and alternative explanations.
B. Proposed mechanism
Explain the behavioral change, component dependencies, expected effect on each objective, costs, and uncertainty. Clearly distinguish tools, hooks, guidance, and reused capabilities.
C. Concrete implementation
Provide the code or exact edits, interfaces, trigger and state logic, and instruction text needed to realize the candidate.
D. Predicted behavior
Walk through the relevant decision points in the cited trajectories and explain how the candidate would respond. Include a case where it should not intervene and observations that would weaken the hypothesis. Label these as predictions rather than measured improvements.
Input template:
<round_context>{{ROUND_CONTEXT}}</round_context> <current_harness>{{CURRENT_HARNESS}}</current_harness> <runtime_contract>{{RUNTIME_CONTRACT}}</runtime_contract> <comparison_settings>{{COMPARISON_SETTINGS}}</comparison_settings> <training_eligibility_rules>{{TRAINING_ELIGIBILITY_RULES}}</training_eligibility_rules> <preparation_trajectories>{{PREPARATION_TRAJECTORIES}}</preparation_trajectories> <rollout_metadata>{{ROLLOUT_METADATA}}</rollout_metadata> <previous_proposals>{{PREVIOUS_PROPOSALS}}</previous_proposals>
Figure 21 Teacher instruction for tool and hook proposals and implementation. Part 5 of 5. The input template follows the instruction.