Files
myWiki/concepts/loop-engineering.md

64 lines
2.4 KiB
Markdown
Raw 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: "Loop Engineering循环工程"
created: 2026-06-29
updated: 2026-06-29
type: concept
tags: [loop-engineering, agent, automation, paradigm]
sources: [[prompt-to-loop-engineering-2026]]
confidence: high
---
# Loop Engineering
> 公式:**Loop = Cron + 决策器**。AI 开发范式四次浪潮的第四阶段2026系统从人类单次触发演进为具备独立运行周期的自主工程。
## 核心转变
人类从 Agent 循环的**内部走向外部**,从执行者变为设计者。大模型在系统中的定位转变为受控的"子程序",控制权交给由状态机和多 Agent 编排构建的闭环架构。
## 架构哲学
[[mechanism-policy-separation|机制与策略分离]]底层平台Harness提供基础机制定时器、工作区隔离控制策略触发时机、子 Agent 数量)由架构师独立配置。
## 三级成熟度
参见 [[loop-maturity-levels|Loop 成熟度]]
1. **Open Loop开环**:模型自行判断 done 即结束,仅适用于 Demo
2. **Closed Loop闭环**:每轮强制通过单元测试 / Lint / Review生产级交付标准
3. **Review Loop评审环**:后台常驻异步审查 Agent 持续反馈,长会长任务最优解
## 五件套 + 一个记忆
| 组件 | 职责 |
|------|------|
| Automations | 心跳机制Cron / GitHub Actions |
| Worktrees | 子 Agent 并行隔离工作区 |
| Skills | 领域知识固化为配置/规范 |
| Plugins / Connectors | [[mcp|MCP]] 连接器,赋予真实动作能力 |
| Sub-agents | 研发与审计分离的多 Agent 编排 |
| State 文件 | 落盘记忆,运行进度持久化 |
## 安全约束
- [[loop-contract|Loop Contract]]六维约束TRIGGER / SCOPE / ACTION / BUDGET / STOP / REPORT
- [[circuit-breaker-pattern|熔断器]]:连续失败 N 次 → 跳闸 + 回退 + 转交人工
- [[watchdog-pattern|看门狗]]:独立进程监控 CPU防自旋死循环
## 自主闭环流水线
> AI 编码 → 沙箱测试 → 日志自动回灌 → AI 修复 → CI 绿标通过 → 自动发起 PR
全流程无人类介入。
## 嵌套关系
Loop 是最外层调度引擎:**Prompt ⊂ Context ⊂ Harness ⊂ Loop**。
## 相关概念
- [[loop-designer|Loop Designer]]
- [[harness-engineering|Harness Engineering]]
- [[harness-as-a-service|HaaS]]
- [[prompt-to-harness-evolution|三阶段工程演进]]
- [[agent-harness|Agent Harness]]