HyperAIHyperAI

Command Palette

Search for a command to run...

하네스 핸드북: 진화하는 에이전트 하네스를 읽기 쉽고, 탐색 가능하며, 편집 가능하게 만들기

Ruhan Wang Yucheng Shi Zongxia Li Zhongzhi Li Yue Yu Junyao Yang Kishan Panaganti Haitao Mi Dongruo Zhou Leoweiliang

초록

현대 AI 에이전트의 역량은 기반 모델뿐만 아니라 프롬프트를 구성하고, 상태를 관리하며, 도구를 호출하고, 실행을 조정하는 하네스(harness)에 달려 있다. 모델, API, 실행 환경, 애플리케이션 요구사항이 변화함에 따라 하네스는 지속적으로 수정되어 기능을 추가하거나 기존 동작을 적응시켜야 한다. 인간 개발자나 코딩 에이전트가 이러한 변경을 수행하려면 먼저 대상 동작을 구현하는 모든 코드 위치를 식별해야 한다. 이는 프로덕션 하네스가 종종 크고, 강하게 결합되어 있으며, 동작이 파일, 함수, 실행 단계, 상태 전환에 걸쳐 분산되어 있기 때문에 어렵다. 반면 수정 요청은 시스템이 무엇을 해야 하는지 설명하고, 저장소는 파일, 함수, 모듈로 구성된다. 코드 검색, 저장소 인덱싱, 긴 컨텍스트 처리에 대한 기존 접근 방식은 코드를 더 쉽게 검사할 수 있게 하지만, 여전히 개발자와 코딩 에이전트가 이 매핑을 스스로 복구하도록 남겨둔다. 따라서 동작 지역화(behavior localization)는 하네스 진화의 핵심 병목 지점이다. 우리는 정적 프로그램 분석과 LLM 지원 동작 구조화를 통해 하네스 코드베이스에서 자동으로 합성되는 동작 중심 표현인 하네스 핸드북(Harness Handbook)을 소개한다. 이는 시스템 동작을 중심으로 구현 지식을 조직화하고 각 동작을 해당 소스 코드에 연결한다. 또한 동작 기반 점진적 공개(Behavior-Guided Progressive Disclosure, BGPD)를 소개하는데, 이는 코딩 에이전트가 고수준 동작 설명에서 관련 구현 세부 사항으로 안내하고 현재 소스를 기준으로 후보 위치를 검증한다. 우리는 두 개의 오픈소스 에이전트 하네스에서 다양한 수정 요청에 대해 하네스 핸드북을 평가했다. 핸드북 지원 계획은 더 적은 플래너 토큰을 사용하면서 동작 지역화와 편집 계획 품질을 향상시킨다. 가장 큰 이득은 분산된 구현 지점, 드물게 실행되는 코드 경로, 모듈 간 상호작용을 포함하는 변경에서 나타난다. 이러한 발견은 복잡한 에이전트 시스템의 진화가 단순히 편집을 생성하는 것뿐만 아니라 그러한 편집이 어디에서 이루어져야 하는지 결정하는 데에도 달려 있음을 시사한다.

One-sentence Summary

Tencent HY LLM Frontier, Indiana University, and colleagues introduce the Harness Handbook, a behavior-centric representation automatically synthesized via static analysis and LLM structuring that maps agent harness behaviors to source code, and Behavior-Guided Progressive Disclosure, which guides coding agents from high-level behavior descriptions to relevant implementation details, thereby substantially improving behavior localization and edit-plan quality for complex modifications to AI agent harnesses, especially when changes involve scattered implementations or cross-module interactions.

Key Contributions

  • The paper introduces Harness Handbook, a behavior-centric representation automatically synthesized from a harness codebase through static program analysis and LLM-assisted behavioral structuring, which links each system behavior to its distributed source implementations.
  • It presents Behavior-Guided Progressive Disclosure (BGPD), a method that guides coding agents from high-level behavior descriptions to relevant implementation details and verifies candidate code locations against the current source.
  • Evaluations on two open-source agent harnesses show that handbook-assisted planning improves behavior localization and edit-plan quality while using fewer planner tokens, with the largest gains for changes involving scattered implementation sites, rarely executed code paths, and cross-module interactions.

Introduction

The authors address the challenge of modifying production-scale agent harnesses, the software layer that coordinates prompt construction, tool invocation, state management, and execution flow in LLM-based agentic systems. As models and environments evolve, developers or coding agents must locate every implementation site responsible for a desired behavioral change, a task the authors term behavior localization. Prior repository representations, such as maps, code search, and summarization, organize code by files and functions but fail to show how scattered code pieces collectively produce a runtime behavior; coding agents still face iterative, error-prone exploration. To bridge this gap, the authors introduce Harness Handbook, a behavior-centric representation that explicitly links what the harness does to the source code that implements it, built automatically through static analysis and LLM-assisted structuring. They also propose Behavior-Guided Progressive Disclosure (BGPD), which guides agents from high-level behavior descriptions to concrete code locations. Evaluations on two open-source harnesses show that Handbook-assisted planning improves behavior localization and edit-plan quality while reducing planner token consumption.

Dataset

The authors construct a harness handbook from an existing code repository; this handbook serves as the structured knowledge source used by the model. Its composition and processing are as follows:

  • Dataset composition and sources

  • The sole source is a code repository R (C, C++, or similar) representing a harness or firmware library.

  • The resulting handbook is a hierarchical document with three levels (L1–L3) and a cross‑stage state‑register overview.

  • Two leaf granularities are available:

  • function‑as‑leaf – each L3 entry covers a whole function or contiguous regions of a function.

  • file‑as‑leaf – each L3 entry represents an entire source file.

  • Key details for each subset/mode

  • function‑as‑leaf mode:

  • Used when a trusted seed skeleton that faithfully reflects execution stages exists and function‑level detail fits a budget.

  • Seed skeleton provides initial stage and state‑register definitions.

  • file‑as‑leaf mode:

  • Used when no seed skeleton is available or function‑level organization would exceed the budget.

  • The pipeline infers the stage skeleton from file summaries and program graph; an optional review loop refines the structure.

  • Both modes produce the same L1–L3 representation and flag unresolved issues in a separate issues record Y.

  • How the data is used

  • The handbook is used as a model input for source localization and resynchronisation tasks; it provides a traceable mapping from behavioural stages back to specific source locations.

  • The training/usage mixture is not a traditional data split but a single constructed handbook; the mode is selected once per project based on trustworthiness of the seed skeleton and budget.

  • Processing and construction pipeline

  1. Static Fact Extraction (Phase I)
  • Language‑specific adapters parse the repository to extract functions, named boundaries, source locations, signatures, and call edges.
  • A program graph G keeps only internal calls or calls to named boundaries; unresolved calls are logged, not guessed.
  • This phase is deterministic and uses no language model calls.
  1. Behavioral Organization (Phase II)
  • Function‑as‑leaf: proposes function‑to‑stage assignments using source and call graph context; assignments are reviewed iteratively and can map a function to multiple stages or split it into contiguous regions.
  • File‑as‑leaf: generates file cards, combines them with the program graph to infer stage skeleton S, organises files by stage, and optionally refines via proposal and review.
  1. Hierarchical Synthesis and Packaging (Phase III)
  • Converts the stage skeleton and organisation into the L1–L3 document tree and cross‑stage state‑register view.
  • Each L3 entry is linked to a statically identified source location and validated against the current repository, ensuring traceability.
  • The chapter view V is rendered and structured data is packaged for downstream source localisation and future resynchronisation.

Method

The authors introduce Harness Handbook, a system designed to understand and modify an agent harness by organizing source code around runtime behavior. The system comprises three core components: a behavior-oriented representation, a construction pipeline, and a modification workflow.

Harness Handbook Representation Source repositories indicate where code is stored but do not directly reveal how runtime behavior unfolds across files and stages. The Harness Handbook reorganizes this information around behavior while preserving links to the source. As shown in the framework diagram, the representation consists of an L1–L3 document tree DDD and a complementary state-register view ZZZ.

Readers typically start at L1 (system overview), which summarizes the architecture, execution model, major stages, and global data flow. They then move to L2 (component overview) for the responsibilities, inputs, outputs, dependencies, and local state of a selected stage. Finally, L3 (unit deep dive) links that stage to source-grounded implementation entries. The complementary view ZZZ records state relationships that cross stage boundaries. Two rules maintain the representation's utility: progressive disclosure, where readers move from L1 to L3 only when more detail is required, and behavior-implementation alignment, ensuring every active L3 locator resolves to the current repository.

Construction Pipeline The construction pipeline builds the handbook from a repository RRR using a fixed leaf mode g{function,file}g \in \{function, file\}g{function,file}, which determines the granularity of L3 entries. Once the leaf mode is chosen, construction proceeds in three phases.

Phase I, Static Fact Extraction, uses language-specific adapters to parse the repository and extract functions, named external boundaries, source locations, signatures, and call edges. This phase is deterministic and produces a program graph GGG. Phase II, Behavioral Organization, organizes source units into the execution-stage skeleton SSS. In function-as-leaf mode, the pipeline uses source and call-graph context to propose function-to-stage assignments, refined through iterative review. In file-as-leaf mode, the pipeline summarizes scanned files as cards and combines them with the program graph to infer the stage skeleton. Phase III, Hierarchical Synthesis and Packaging, converts the stage skeleton and source organization into the L1–L3 document tree and cross-stage state-register view. Each L3 entry is linked to a statically identified source location and validated against the current repository.

Handbook-Guided Modification and Resynchronization After construction, the handbook serves as a behavior-oriented guide for modifying the repository. Given a request qqq, the workflow uses the handbook HHH and repository RRR.

The workflow begins with Behavior-Guided Progressive Disclosure (BGPD), which localizes the requested behavior through coarse-to-fine handbook navigation. BGPD identifies relevant execution stages using L1 and L2, follows the state-register view ZZZ to include coupled stages, and selects relevant L3 entries. It then expands the candidate set along call relations and verifies these sites against the current repository to produce verified evidence E^q\widehat{E}_{q}Eq.

Next, a planner converts E^q\widehat{E}_{q}Eq into an edit plan PPP and action declarations Γ\GammaΓ. An executor applies PPP to the repository, producing an updated repository RR'R and a diff Δ\DeltaΔ.

Finally, any non-empty diff triggers handbook resynchronization. The procedure reparses the changed source, refreshes the program graph, and aligns old and new versions to identify added, removed, and modified units. If the stage skeleton remains valid, only affected entries are refreshed; otherwise, the construction algorithm is rerun. This ensures the handbook remains consistent and up-to-date with the repository.

Experiment

The experiments assess handbook-guided localization for edit planning on two open-source agent harnesses, comparing a baseline that explores code directly against an arm that follows a navigation policy based on the handbook. Handbook assistance consistently improves plan quality across judges and dimensions while reducing planner token usage. It enables a weaker planner to match the localization accuracy of stronger models, cutting complete misses, and these gains persist across request types and difficulty levels.

Handbook guidance consistently improves reference-plan localization metrics (Recall, Precision, F1) across two harnesses, two reference models, and both file and symbol granularities, with F1 gains reaching up to 18.8 points. Recall and precision rise together, indicating better focus rather than simply returning more candidate sites, and the share of requests with zero overlap (Wrong) never increases and falls by as much as 25.9 points, meaning fewer complete localization failures. On the Terminus-2 harness, handbook assistance brought file-level F1 to 84.7% and 89.3% against Opus 4.8 and GPT-5.5 references, respectively, and precision against GPT-5.5 reached 93.3% at both file and symbol granularity. The Wrong rate, which measures requests with no overlap to the reference, dropped by up to 25.9 percentage points; on the Codex harness against the Opus 4.8 reference, Wrong fell from 37.0% to 14.8%.

The evaluation measured the effect of supplementary handbook guidance on reference-plan localization using two harnesses, two reference models, and both file and symbol granularities. Guidance consistently raised recall and precision in tandem, lifting F1 scores by as much as 18.8 points and driving down the rate of completely missed localizations by up to 25.9 percentage points, indicating that the handbook narrows attention rather than simply surfacing more candidates. These gains held across all setups, demonstrating that the guidance robustly improves localization accuracy and reduces outright failures.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp