Manuscript Offprint

arXiv:2610.20344

Doc2Harness: Benchmarking LLMs on Long-Horizon Harness Engineering of Coding Agents

Yuyao Ge, Shenghua Liu, Peizhong Gao, Chendi Ge, Chenxu Liu, Yiwei Wang, Lingrui Mei, Baolong Bi, Jiayu Yao, Jiafeng Guo, Xueqi Cheng

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

Abstract

Agents driven by large language models are increasingly deployed on long-horizon tasks, where they use tools and modify real workspaces. How well they perform depends as much on the harness around the model as on the model itself. Existing benchmarks measure downstream task success under a fixed harness, leaving harness engineering itself unexplored. We propose Doc2Harness, a two-stage benchmark that evaluates long-horizon harness engineering directly. In Stage 1, a build model operating inside a fixed builder harness receives an interface-only contract skeleton and a development document that consolidates behavior across twelve frontier harnesses, and then constructs a complete candidate harness in an isolated container. In Stage 2, the frozen candidate harness runs in containers separate from the construction environment, one per test case, and is driven end to end by a scripted mock model. We score each test case using four observable channels, namely the requests sent to the model, the files on disk, the process exit code, and the command output; positive controls rule out vacuous passes. Across nineteen frontier models, each evaluated with three independent builds on 328 test cases, GPT-6 Astra achieves the highest pass rate at 53.05%, while the weakest model reaches 27.44%, a gap of roughly twenty-six percentage points. Even the strongest model fails nearly half of the test cases, and failures cluster around how cross-cutting functionality is split across modules. To our knowledge, Doc2Harness provides the first deterministic benchmark for measuring long-horizon harness engineering.

†^{\dagger} Corresponding author.

1 Introduction

As coding agents driven by large language models (LLMs) become more capable, they are deployed in increasingly complex settings (Ge et al., 2025). The harness therefore matters more: it manages the interaction loop, tool execution, context, permissions, session state, failure recovery, and result verification, and so determines how much of the model's capability reaches the environment (Mei et al., 2025). At the same time, human supervision of every agent step has become difficult. This has motivated recursive self-improvement, in which an agent modifies the infrastructure that governs its own behavior. An agent executes a task, observes the outcome, modifies its own harness, and then uses the modified harness on the next task, improving itself over time. A model's ability to generalize this process may ultimately determine the capability of the resulting agent.

Building a harness is a type of software engineering (SWE) task, but it tests a kind of generalization that ordinary SWE tasks do not capture. At the data-source level, the open-source repositories used by SWE benchmarks are mostly mature projects that may have appeared repeatedly in training corpora. Harnesses, by contrast, have appeared only in the past few years and are updated at high frequency, so the resulting evaluation places greater emphasis on generalization. On the evaluation side, existing SWE benchmarks such as SWE-bench Pro (Deng et al., 2026), NL2Repo-Bench (Ding et al., 2026), and Commit0 (Zhao et al., 2025) judge whether the model's output is acceptable using the interactive unit tests supplied with the task. Such criteria do not transfer directly to harnesses, for two reasons. (1) A single feature can be realized in many ways inside a harness, whereas an ordinary unit test observes behavior through a fixed interface. (2) A harness does not complete a downstream task on its own, so its correctness must be assessed by driving it with a model.

We therefore propose Doc2Harness, a two-stage benchmark for evaluating how well LLMs develop harnesses. In Stage 1, the build model under evaluation operates inside a fixed builder harness and, given a development document and a contract skeleton that declares interfaces only, constructs a complete candidate harness inside an isolated container. In Stage 2, the candidate harness is moved into isolated containers, one per test case, launched and executed end to end as a black box, with a mock model providing responses according to a preset script and each test case running the harness through one complete session. We observe four channels for each test case, namely the requests sent to the model, the files on disk, the process exit code, and the command output, and aggregate the resulting statuses into a pass rate. The build model's ability to develop a harness is reflected indirectly in the pass rate.

Both inputs are designed to reduce reliance on parametric knowledge that the build model may already possess: the development document is rewritten from the user documentation of twelve frontier harnesses after merging and disambiguation, and the contract skeleton is distilled further from mini-swe-agent (Yang et al., 2024) with all internal implementation removed. For Stage 2, we design several hundred test cases covering a wide range of scenarios. A test case may pass even though the feature under test never ran, a situation we call a vacuous pass; to guard against it we introduce positive controls that verify the observation preconditions. If a positive control fails, the observation precondition is not satisfied, and the test case is recorded as FAIL regardless of its own status.

As shown in Figure 1, we evaluate nineteen frontier models on Doc2Harness, scoring three candidate harnesses per model and ranking them by pass rate. The strongest, GPT-6 Astra, reaches a pass rate of 53.05%, while the weakest reaches 27.44%; this roughly twenty-six-point gap shows that the suite is neither saturated nor unable to discriminate among the models in this cohort. Across categories, a model's rank varies by as many as sixteen positions.

Our contributions are as follows.

  • We propose Doc2Harness, which runs the build model under evaluation inside a fixed builder harness, gives it a development document and a contract skeleton that declares interfaces only, asks it to construct a complete candidate harness inside an isolated container, and then evaluates the result with several hundred test cases.

Stage 1

Figure

Stage 2

Test Case

Figure

Figure 2: Overview of Doc2Harness. Top (Stage 1): the builder, formed from the build model under evaluation and a fixed builder harness (OpenCode), takes the development document and the contract skeleton as input and emits a submission; the contract check verifies form rather than behavior, freezing the deliverable as the candidate harness on success and returning it to the builder on failure. Bottom (Stage 2): the frozen candidate harness and a mock model form the driven harness, which runs the scenario of each test case; effects are read from four channels, namely the requests sent to the model, the files on disk, the process exit code, and the command output, and the positive control gates the status before the assertion decides PASS or FAIL.

  • We provide a test suite that exercises a harness as a black box: the candidate harness is driven by a mock model following a preset script, and positive controls help rule out vacuous passes, keeping the evaluation accurate.

  • We evaluate nineteen frontier models and parse the source of every scored candidate harness. Higher-scoring candidate harnesses tend to place cross-cutting functionality in fewer modules. A model’s rank also moves by up to sixteen positions across the six main categories.

References (35)