Files
myWiki/articles/prompt-to-loop-engineering-2026.md

84 lines
4.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "AI 开发范式演进:从 Prompt Engineering 到 Loop Engineering"
created: 2026-06-29
updated: 2026-06-29
type: article
tags: [prompt-engineering, context-engineering, harness-engineering, loop-engineering, agent, paradigm-evolution]
sources: [https://mp.weixin.qq.com/s/hcgKahtQRE2QqI6xplv2Rg]
authors: ["邱汉宸(东南大学、阿里淘天)"]
platform: Datawhale
---
# AI 开发范式演进:从 Prompt Engineering 到 Loop Engineering
> 来源:[Datawhale 公众号](https://mp.weixin.qq.com/s/hcgKahtQRE2QqI6xplv2Rg),作者:邱汉宸
## 一句话
系统性复盘 AI 开发范式的四次浪潮:**Prompt Engineering → Context Engineering → Harness Engineering → Loop Engineering**,揭示人类从 Agent 循环内部走向外部、从执行者变为设计者的范式迁移。
## 核心命题
20252026 年三句话引爆 AI 社区:
- "I really like the term 'context engineering' over prompt engineering." — Tobi Lütke, Shopify CEO
- "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents." — Peter Steinberger, OpenClaw
- "I don't prompt Claude anymore. I have loops running. My job is to write loops." — Boris Cherny, Claude Code
## 四次浪潮
### 1. [[prompt-engineering|Prompt Engineering]]20222024
"如何跟 AI 沟通"。核心方法论Zero-shot/Few-shot、Instruction Prompting、[[dspy|DSPy]] 声明式自动编译。瓶颈:上下文窗口限制、缺乏记忆/工具调用、[[blind-prompting|盲提示]] 带来的技术债务。
### 2. [[context-engineering|Context Engineering]]2025
"信息怎么喂给模型"。三大方法论:
- [[minimum-viable-context|轻量化装配 (MVC)]]
- [[graphrag|知识图谱增强检索 (GraphRAG)]]
- [[just-in-time-retrieval|即时检索 (JIT Retrieval)]]
三种故障模式:[[context-failure-modes|信息匮乏 / 信息过载 / 上下文腐烂]]。关键隐性维度:[[prefix-matching-invariant|前缀匹配不变性]] 与 [[prompt-caching|提示词缓存]] 的成本经济学。
### 3. [[harness-engineering|Harness Engineering]]2026
"Agent = Model + Harness"。四大支柱环境资产与工具集、控制与编排逻辑、规则中间件Hooks、运行时可观测性。八条[[model-proposes-harness-executes|非妥协原则]]。DataTalks.Club 事故案例Claude Code 执行 `terraform destroy` 抹除生产数据库 — 问题不在模型,在 Harness 缺位。
### 4. [[loop-engineering|Loop Engineering]]2026
"Loop = Cron + 决策器"。系统从人类单次触发的工具演进为具备独立运行周期的自主工程。[[loop-maturity-levels|三级成熟度]]Open Loop → Closed Loop → Review Loop。核心组件 "五件套 + 一个记忆"Automations / Worktrees / Skills / Connectors ([[mcp|MCP]]) / Sub-agents / State 文件。
## 核心框架
### Loop Contract[[loop-contract|循环协议]]
六维约束TRIGGER / SCOPE / ACTION / BUDGET / STOP / REPORT。BUDGET 和 STOP 固化为 [[circuit-breaker-pattern|熔断器]] 和 [[watchdog-pattern|看门狗]] 两道硬约束。
### 嵌套关系
> Prompt ⊂ Context ⊂ Harness ⊂ Loop
### 架构哲学
[[mechanism-policy-separation|机制与策略分离]] — 底层平台提供机制(定时器、工作区隔离),控制策略由架构师独立配置。
## 工程实践
- **[[harness-as-a-service|HaaS脚手架即服务]]**Worktree + Skills + Connector + Subagent + State 封装为标准底座
- **[[skill-issue-framework|Skill Issue 框架]]**CodeRabbit当 Agent 表现不佳,排查 Harness 代码而非责怪模型
- **分层拦截流水线**确定性规则层Semgrep→ 策略网关层OPA→ AI 审查层 → 人类终审80%/15%/5%
## 人类角色转变
开发者进化为 **[[loop-designer|Loop Designer循环设计师]]**,聚焦三件事:
1. 定义终止边界Goal & Verifier
2. 维护工具链与领域资产Tooling & Skill
3. 设计安全断路器Human-in-the-Loop & Budget Guard
## 关键引用
- Terminal Bench 2.0 实证:不改模型权重,仅改写 Harness 约束使排名从 30 → 前五
- 缓存经济学:同一前缀命中第 3 次即可净收益(首次 100% 计费,后续 20%
## 相关概念
- [[prompt-to-harness-evolution|三阶段工程演进]] — 需扩展为四阶段
- [[agent-harness|Agent Harness (Claw)]]
- [[harness-engineering]]
- [[context-engineering]]
- [[prompt-caching]]
- [[human-in-the-loop]]
- [[mcp]]