Files
myWiki/concepts/mechanism-policy-separation.md

46 lines
1.6 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: "Mechanism-Policy Separation机制与策略分离"
created: 2026-06-29
updated: 2026-06-29
type: concept
tags: [architecture, loop-engineering, design-principle]
sources: [[prompt-to-loop-engineering-2026]]
confidence: high
---
# Mechanism-Policy Separation
> 成熟的 [[loop-engineering|循环系统]] 遵循的核心架构哲学:底层平台提供基础**机制**,控制**策略**由架构师独立配置。
## 定义
| 层 | 职责 | 示例 |
|----|------|------|
| **机制Mechanism** | 由 Harness 提供的基础能力 | 定时器、工作区隔离、工具注册、进程管理 |
| **策略Policy** | 由架构师按业务逻辑配置的控制规则 | 触发时机、子 Agent 数量、预算上限、停止条件 |
## 工程价值
1. **解耦演进**:升级机制不改变策略(替换 Cron 实现不影响触发规则)
2. **复用策略**:同一策略可部署到不同 Harness 平台
3. **人类抽离**:架构师设定策略后退出执行循环,系统自主运转
## 在 Loop Contract 中的体现
[[loop-contract|Loop Contract]] 的六维约束正是策略层的实例化:
- 机制层提供Cron 定时器TRIGGER、进程隔离SCOPE、工具调用ACTION
- 策略层配置Cron 表达式、作用仓库、预算红线、停止条件、上报通道
## 与 Harness 的关系
机制层 = [[harness-engineering|Harness Engineering]] 的产物
策略层 = [[loop-designer|Loop Designer]] 的配置域
## 相关概念
- [[loop-engineering|Loop Engineering]]
- [[loop-contract|Loop Contract]]
- [[harness-engineering|Harness Engineering]]
- [[loop-designer|Loop Designer]]