Manuscript Offprint

arXiv:2610.07832

Harness Engineering for Software Engineering via Modular Executable Dev-Primitives

Haibo Jin, Xinjie Li, Peng Kuang, Haohan Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language models (LLMs) equipped with terminal access have demonstrated strong capabilities in automating software engineering tasks. However, existing agents remain brittle on long-horizon workflows, where they must repeatedly reconstruct program state scattered across source files, configurations, tests, dependencies, and runtime behavior, leading to increasingly long interaction histories, context explosion, and semantic drift. Large repositories further complicate the identification of task-relevant components. To address these challenges, we introduce Dev-Primitives (Development Primitives), a modular and executable abstraction that transforms repository components from passive software artifacts into active participants in software engineering. Each Dev-Primitive pairs a repository artifact with a resident LLM, which gives the artifact an agent-native interface grounded in its own implementation and dependencies, enabling natural-language reasoning, inter-component communication, and localized self-modification. Building on Dev-Primitives, we propose HERMES, a Harness Engineering framework for software engineerRing via Modular Executable Dev-PrimitiveS, which instantiates these primitives at repository scale through a dependency-aware dynamic activation mechanism and a bug diagnosis mechanism that maps execution evidence back to the components that must be revised. Extensive experiments on four software engineering benchmarks demonstrate that HERMES outperforms matched baseline harnesses by 12.4% on average. Moreover, when paired with strong activation and diagnosis models, HERMES, even with Qwen3-8B Dev-Primitives, remains within 4.5% of the homogeneous GPT-5.6 Sol configuration across all four benchmarks, while reducing inference cost by 26.2% on Terminal-Bench 4.0, highlighting the importance of harness design in software engineering agents.

1 INTRODUCTION

Large language models (LLMs) equipped with terminal access have demonstrated remarkable capability in automating real-world software engineering (Yang et al., 2024; Wang et al., 2025). Existing approaches broadly follow two paradigms. Pipeline-based methods prescribe the control flow in advance, decomposing software repair into stages such as fault localization, patch generation, and validation (Xia et al., 2025; Zhang et al., 2024). Agent-based methods instead place an LLM in an interactive execution environment, where it can inspect repositories, execute commands, modify code, and react to runtime feedback through a general action loop (Wang et al., 2024; 2025). Recent benchmarks have meanwhile expanded from isolated issue resolution to tasks that require sustained interaction with repositories, terminals, tests, and runtime systems (Merrill et al., 2026).

Both paradigms remain brittle once such interactions extend over long horizons. Append-only histories and passive compression lead to context explosion, semantic drift, and degraded reasoning (Liu et al., 2026; Wang et al., 2026a). In software repositories, however, the difficulty is not only the length of the history: the relevant program state is scattered across interdependent source files, configurations, and tests, so a change to one file often requires matching changes in the code that calls it, its configuration, and its tests. Each edit also changes the repository itself, so the agent must repeatedly re-inspect affected files and work out what each change requires elsewhere, a burden

*Corresponding Author: haohanw@illinois.edu that no amount of history compression removes. Recent evaluations expose this clearly: on whole-repository migration, only 5.4% of 520 agent runs complete all evaluation stages (Hong et al., 2026), and similar difficulties appear in long-horizon software evolution and repository generation (Le et al., 2025; Ding et al., 2025). This raises a natural question: instead of requiring an agent to repeatedly reconstruct distributed program state, can individual software components reason about their own responsibilities and communicate relevant information directly to one another?

We answer this question with Dev-Primitives (Development Primitives), modular and executable abstractions that transform repository components from passive code artifacts into active participants. Each Dev-Primitive wraps a repository artifact with a resident LLM, and this is what makes the artifact agent-native: because the resident model reads the implementation it is attached to, the component can be addressed in natural language and can answer for its own implementation and dependencies. Through this interface it interprets requests, reasons over its own artifact, communicates requirements and constraints to other primitives, and modifies its implementation when necessary, so that component-specific information and reasoning stay with the artifact that owns them.

Dev-Primitives alone, however, do not determine which components a task should involve: repositories may contain thousands of components, and activating all of them would be wasteful. We therefore introduce HERMES, a Harness Engineering framework for software engineerRing via Modular Executable Dev-PrimitiveS, which adds two mechanisms. Dynamic activation localizes the components likely to implement the reported behavior, follows their dependencies to the callers, configurations, and tests that may need to change with them, and instantiates only the Dev-Primitives in this candidate set, which modify their artifacts and exchange requirements before the repository is executed. Because a single round often leaves the issue unresolved, and execution reports only that the repository still fails rather than which component should be revised, a bug diagnosis mechanism traces the failure back to the components it implicates and reactivates only those primitives, repeating until the repository passes or a revision budget is exhausted.

Extensive experiments on four software engineering benchmarks show that HERMES consistently improves over existing harnesses across issue resolution, whole-repository refactoring, terminal-based tasks, and DevOps workflows. Under the default GPT-5.6 Sol setting with medium reasoning effort, it improves performance by 12.4 percentage points on average. With strong activation and diagnosis models, HERMES using Qwen3-8B Dev-Primitives stays within 4.5 percentage points of the homogeneous GPT-5.6 Sol configuration while reducing inference cost by 26.2% on Terminal-Bench 4.0. These results demonstrate the importance of harness design in software engineering agents. Our contributions are summarized as follows:

• We introduce Dev-Primitives, modular executable interfaces that turn repository components into active software engineering participants capable of localized reasoning, natural-language inter-component communication, and self-modification.

• We propose HERMES, a Harness Engineering framework for software engineerRing via Modular Executable Dev-PrimitiveS, which instantiates Dev-Primitives at repository scale through a dependency-aware dynamic activation mechanism and a bug diagnosis mechanism that maps execution evidence back to the components that must be fixed.

• We evaluate HERMES on four software engineering benchmarks spanning issue resolution, whole-repository refactoring, terminal-based tasks, and DevOps workflows. HERMES improves over matched baseline harnesses by 12.4 percentage points on average, while Qwen3-8B Dev-Primitives remain within 4.5 percentage points of the homogeneous GPT-5.6 Sol configuration and reduce Terminal-Bench 4.0 inference cost by 26.2%.

References (60)