41 lines
1.6 KiB
Markdown
41 lines
1.6 KiB
Markdown
---
|
||
title: "7-Layer Harness Stack"
|
||
type: concept
|
||
tags:
|
||
- "harness-engineering"
|
||
- "agentic-ai"
|
||
- "system-design"
|
||
sources:
|
||
- "Your-AI-Isn-t-Stupid---It-Just-Needs-a-Better-Harness--Lychee-Technology-Engineering-Blog"
|
||
last_updated: 2026-04-20
|
||
---
|
||
|
||
## Overview
|
||
7层 Harness Stack——production-grade AI Agent 系统的分层架构规范,从认知层到约束恢复层的完整 7 层结构。
|
||
|
||
## Structure
|
||
|
||
| Layer | Name | Core Function |
|
||
|-------|------|--------------|
|
||
| 1 | Cognition | 受限操作边界,role file/job description |
|
||
| 2 | Tools | 工具输出排序/去重/token 预算截断 |
|
||
| 3 | Contracts & Interfaces | JSON Schema 边界验证,防 Schema Drift |
|
||
| 4 | Orchestration | DAG/状态机约束允许的动作 |
|
||
| 5 | Memory & State | Working Memory + Persistent State 分层 |
|
||
| 6 | Evaluation & Observation | 异构验证(规则/工具/LLM-as-judge)|
|
||
| 7 | Constraints & Recovery | 幂等重试,Context Reset 机制 |
|
||
|
||
## Principles
|
||
- 模型在 Harness 内部,不直接对用户或外部世界说话
|
||
- 每个边界交叉处有显式契约:严格 JSON Schema / 类型化函数签名 / 版本化 API spec
|
||
- 每一层产生可被模型以外的东西验证的输出
|
||
|
||
## Related Concepts
|
||
- [[Harness-Engineering]] — 父概念,本框架所属的工程学科
|
||
- [[Context-Reset]] — 第 7 层 Constraints & Recovery 的关键机制
|
||
- [[Sprint-Contract]] — 第 6 层 Evaluation 的关键机制
|
||
- [[Schema-Drift]] — 第 3 层 Contracts 要解决的核心问题
|
||
|
||
## Source
|
||
- [[Your-AI-Isn-t-Stupid---It-Just-Needs-a-Better-Harness--Lychee-Technology-Engineering-Blog]]
|