Aha.
正在载入中英对照阅读…

arXiv:2607.00038 · 中英对照阅读

别再手把手引导你的编码智能体:设计取代逐步提示的循环工程

Stop Hand-Holding Your Coding Agent: Engineering the Loops that Replace Step-by-Step Prompting

Sandeco Macedo

中文速览

代码智能体要想从“等人一步步指挥”变成“自己持续做事”,关键是怎样设计一套可靠、可重复的循环,而不是单纯把提示词写得更长。作者把这种循环叫作“循环规格”(loop specification):给智能体设定启动条件、目标、执行方式、结果检查、停止规则和可保存的记忆,并强调检查必须能提供真实证据,不能让智能体只靠自我评价。对公开收录的50个真实循环进行分析后,作者发现,70%设有较自主的验证方式,74%明确写出何时结束,但自动触发和长期记忆还比较薄弱。这项工作为新兴实践建立了定义、分类和设计原则,也提醒使用者:自动化越强,越要认真核验结果、理解系统行为,避免把判断力一并交给智能体。

摘要

2026年年中,一句口号重塑了从业者谈论编码智能体的方式:别再提示你的智能体,开始设计向它发出提示的循环。我们认真对待这一主张,并对其作出细致阐释。我们将这一新实践的对象称为循环规范:一种有界、可复用的产物,由触发条件、目标、验证步骤、停止规则和记忆构成,由人交给智能体框架(例如 Claude Code 或 Codex),使智能体能够自行追求目标,取代逐步提示。我们将这种外部循环规范与两种常被混淆的事物区分开来:普通的编程循环,以及智能体框架已作为底层机制提供的内部感知—行动—观察循环。我们将循环工程定位为从提示到上下文、再到框架、最后到循环这一演进过程中的新层,并反对那些更强势的标题所宣称的观点:循环工程并未取代提示工程;循环与提示是用途各异的两种工具。我们提出四项贡献:为这一学科给出定义并界定其范围;围绕触发条件、目标类型、五级验证阶梯、架构和具名终止状态,梳理循环规范的构成与分类体系;对公开语料库 Loop Library(循环库)进行描述性分析,该库收录了五十个真实循环,我们对其进行了人工编码;以及基于自我纠正、奖励劫持和模型作为评审者的脆弱性相关科学文献,提出一系列设计原则与反模式。语料库表明,实践在学科认为至关重要的方面最为成熟:百分之七十的循环在验证阶梯的自主区间内进行验证,百分之七十四的循环明确命名其终止状态;相比之下,自动触发和持久记忆的发展仍不充分。最后,我们指出这一实践必须尊重的局限,包括验证负担、理解债务以及认知投降的风险。

In mid-2026 a slogan reorganized how practitioners talk about coding agents: stop prompting your agent, start designing the loop that prompts it. We take this claim seriously and give it a careful treatment. We call the object of the new practice the loop specification: a bounded, reusable artifact, made of a trigger, a goal, a verification step, a stopping rule and a memory, that a human hands to an agent harness (such as Claude Code or Codex) so the agent pursues a goal on its own, in place of step-by-step prompting. We distinguish this external loop specification from two things it is often confused with: an ordinary programming loop, and the internal perceive-act-observe cycle that the harness already provides as plumbing. We position loop engineering as a new layer in the progression from prompt to context to harness to loop, and we argue, against the stronger headlines, that it does not retire prompt engineering; loop and prompt are distinct tools with distinct uses. We offer four contributions: a definition and scope for the discipline; an anatomy and taxonomy of loop specifications organized around trigger, goal type, a five-level verification ladder, architecture, and named terminal states; a descriptive analysis of the Loop Library, a public corpus of fifty real loops that we code by hand; and a set of design principles and anti-patterns grounded in the scientific literature on self-correction, reward hacking and model-as-judge fragility. The corpus shows that practice has matured most where the discipline says it matters: seventy percent of loops verify in the autonomous zone of the ladder and seventy-four percent name their terminal states, while automated triggering and durable memory remain comparatively underdeveloped. We close with the limits the practice must respect, including the verification burden, comprehension debt and the risk of cognitive surrender.

术语表

coding agent
编码智能体
loop engineering
循环工程
loop specification
循环规范
agent harness
智能体框架
prompt engineering
提示工程
context engineering
上下文工程
harness engineering
框架工程
programming loop
编程循环
perceive-act-observe cycle
感知—行动—观察循环
Loop Library
Loop Library(循环库)
verification ladder
验证阶梯
terminal state
终止状态
self-correction
自我纠正
reward hacking
奖励劫持
model-as-judge fragility
模型作为评审者的脆弱性
MAPE-K loop
MAPE-K 循环
chain-of-thought prompting
思维链提示
self-consistency
自洽性
least-to-most prompting
由简到繁提示
plan-and-solve
规划与求解
decomposed prompting
分解式提示
self-ask
自问
reasoning via planning
基于规划的推理
Self-Discover
Self-Discover
ReAct
ReAct
Toolformer
Toolformer
ReWOO
ReWOO
LLM+P
LLM+P
DEPS
DEPS
MRKL
MRKL