harness工程:编码智能体的剖析、架构与演进——对十一个系统的源代码研究
Harness Engineering: Anatomy, Architecture, and Evolution of Coding Agents -- A Source-Code Study of Eleven Systems
- Inclusive Brains(包容性大脑)
- Wavestone AI Lab(Wavestone人工智能实验室)
机构由 AI 辅助整理,请以论文原文为准。
AI总结:
本文通过剖析11个编码智能体harness及元harness Omnigent,明确harness定义与架构,发现领域特性,论证2026年上半年编码harness已从工具转向平台,并给出设计建议与最小可行框架。
AI中文摘要:
智能体是模型加上harness(运行时),该运行时通过循环、工具、上下文管理、安全控制、编排和扩展面将大语言模型(LLM)与外部世界耦合。harness工程作为一门学科于2026年初被命名,其研究内容是该运行时的设计与演进。本文为这门新兴学科提供了迄今为止最全面的实证基础:对十一个生产级编码harness(包括Claude Code、Codex CLI、Gemini CLI、Mistral Vibe、OpenHands、Aider、Mini-SWE-Agent、Hermes、Pi、OpenCode、OpenClaw)进行源代码剖析,并将首个元harness Omnigent作为对比对象进行分析。我们定义了harness的内涵,绘制了其七个规范子系统的最小和最大实现,并沿这些子系统对十一个系统进行了详细剖析。该审计得出13个跨领域观察结果和29种常见设计模式的目录。在涵盖约400万行Python、TypeScript和Rust代码的语料库扩展中,发现两个缺失情况:没有智能体运行时导入通用智能体框架,也没有系统通过向量嵌入检索代码;该领域依赖手动编写的异步循环和确定性检索。HTTP URL技能的采用率高于MCP(9/11对8/11),ACP在六个系统中部署并新增了第三个角色:harness托管。由于最初的八个系统是重新固定而非替换,该研究还包含一个受控纵向样本——同一harness在四分之一时间内的源差异分析,显示趋同演变为模仿,行为策略从提示文本迁移到配置。这些线索共同指向本文的核心论点:2026年上半年,编码harness完成了从工具到平台的转变。本文最后提出18条设计建议和一个90行的最小可行harness框架。
英文摘要:
An agent is a model plus a harness -- the runtime that couples an LLM to the world through a loop, tools, context management, safety controls, orchestration, and extension surfaces. Harness engineering, named as a discipline in early 2026, is the design and evolution of that runtime. This paper gives the young discipline its most comprehensive empirical foundation to date: a source-code anatomy of eleven production coding harnesses (Claude Code, Codex CLI, Gemini CLI, Mistral Vibe, OpenHands, Aider, Mini-SWE-Agent, Hermes, Pi, OpenCode, OpenClaw), plus Omnigent, the first meta-harness, analyzed as a contrast point. We define what a harness is, map its seven canonical subsystems with the minimal and maximal implementation of each, and dissect all eleven systems along those subsystems. The audit yields 13 cross-cutting observations and a catalog of 29 recurring design patterns. Two absences survive a threefold corpus expansion: across roughly four million lines of Python, TypeScript, and Rust, no agent runtime imports a general-purpose agentic framework, and none retrieves code with vector embeddings; the field runs on hand-rolled async loops and deterministic retrieval. SKILL.md skills lead MCP in adoption (9/11 vs. 8/11), and ACP ships in six systems with a new third role: harness hosting. Because the original eight systems were re-pinned rather than replaced, the study also contains a controlled longitudinal sample -- the same harnesses source-diffed across one quarter -- showing convergence becoming imitation and behavioral policy migrating from prompt prose to configuration. These threads converge on the paper's thesis: in the first half of 2026 the coding harness completed a turn from tool to platform. The paper closes with 18 design recommendations and a 90-line minimum-viable-harness scaffold.