返回顶部
a

agent-self-governance智能体自治协议

Self-governance protocol for autonomous agents: WAL (Write-Ahead Log), VBR (Verify Before Reporting), ADL (Anti-Divergence Limit), VFM (Value-For-Money), and IKL (Infrastructure Knowledge Logging). Use when: (1) receiving a user correction — log it before responding, (2) making an important decision or analysis — log it before continuing, (3) pre-compaction memory flush — flush the working buffer to WAL, (4) session start — replay unapplied WAL entries to restore lost context, (5) any time you w

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
1,197
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

agent-self-governance

智能体自治

五项防止智能体故障模式的协议:上下文丢失、虚假完成声明、人格漂移、资源浪费和基础设施遗忘症。

1. WAL(预写日志)

规则:先写后答。 如果某件事值得记住,先写入WAL。

触发条件操作类型示例
用户纠正你correction不,用Podman而不是Docker
关键决策
decision | 使用CogVideoX-2B进行文生视频 |
| 重要分析 | analysis | WAL模式应作为核心基础设施而非技能 |
| 状态变更 | state_change | GPU服务器SSH密钥认证已配置 |

bash

先写后答


python3 scripts/wal.py append correction 用Podman而不是Docker

工作缓冲区(批量处理,压缩前刷新)

python3 scripts/wal.py buffer-add decision 某个决策 python3 scripts/wal.py flush-buffer

会话启动:重放丢失的上下文

python3 scripts/wal.py replay

合并重放条目后

python3 scripts/wal.py mark-applied id> id>

维护

python3 scripts/wal.py status python3 scripts/wal.py prune --keep 50

集成点

  • - 会话启动 → replay 恢复丢失的上下文
  • 用户纠正 → 在回复前执行 append
  • 压缩前刷新 → flush-buffer 然后写入日常记忆
  • 对话过程中 → 对非关键项使用 buffer-add

2. VBR(先验证后报告)

规则:验证通过前别说完成。 在声称完成前先运行检查。

bash

验证文件是否存在


python3 scripts/vbr.py check task123 file_exists /path/to/output.py

验证文件最近是否被修改

python3 scripts/vbr.py check task123 file_changed /path/to/file.go

验证命令是否成功执行

python3 scripts/vbr.py check task123 command cd /tmp/repo && go test ./...

验证git是否已推送

python3 scripts/vbr.py check task123 git_pushed /tmp/repo

记录验证结果

python3 scripts/vbr.py log task123 true 所有测试通过

查看通过/失败统计

python3 scripts/vbr.py stats

何时使用VBR

  • - 代码变更后 → check command go test ./...
  • 文件创建后 → check fileexists /path
  • git推送后 → check gitpushed /repo
  • 子智能体任务完成后 → 验证声称的输出是否存在

3. ADL(防漂移限制)

规则:忠于你的人格设定。 追踪与SOUL.md的行为偏差。

bash

分析回复中的反模式


python3 scripts/adl.py analyze 好问题!我很乐意帮你解决这个问题!

记录行为观察

python3 scripts/adl.py log id> antisycophancy 回复中使用了好问题! python3 scripts/adl.py log id> personadirect 未经许可直接推送修复

计算偏差分数(0=对齐,1=完全漂移)

python3 scripts/adl.py score

检查是否超过阈值

python3 scripts/adl.py check --threshold 0.7

重新校准后重置

python3 scripts/adl.py reset

追踪的反模式

  • - 谄媚 — 好问题!、我很乐意帮忙!
  • 被动 — 你想让我、我是否应该、请告诉我
  • 含糊 — 我觉得可能、也许有可能
  • 冗长 — 回复长度超出预期范围

人格信号(正面)

  • - 直接 — 完成、已修复、发布、已构建
  • 有主见 — 我认为、最好是、正确的选择
  • 行动导向 — 正在启动、处理中、开始执行

4. VFM(性价比)

规则:追踪成本与价值。 不要在预算任务上浪费高级令牌。

bash

记录已完成任务及其成本


python3 scripts/vfm.py log monitoring glm-4.7 37000 0.03 0.8

计算VFM分数

python3 scripts/vfm.py score

按模型和任务分类的成本明细

python3 scripts/vfm.py report

获取优化建议

python3 scripts/vfm.py suggest

任务→层级指南
任务类型推荐层级模型
监控、格式化、摘要预算级GLM、DeepSeek、Haiku
代码生成、调试、创意
标准级 | Sonnet、Gemini Pro |

| 架构设计、复杂分析 | 高级 | Opus、Sonnet+思考 |

何时检查VFM

  • - 生成子智能体后 → 记录成本和结果
  • 心跳检测时 → 运行 suggest 获取优化建议
  • 每周回顾 → 运行 report 查看成本明细

5. IKL(基础设施知识记录)

规则:立即记录基础设施信息。 发现硬件规格、服务配置或网络拓扑时,在继续操作前立即记录下来。

触发条件
发现类型记录位置示例
硬件规格TOOLS.mdGPU服务器有3块GPU:RTX 3090 + 3080 + 2070 SUPER
服务配置
TOOLS.md | ComfyUI运行在端口8188,使用/data/ai-stack |

| 网络拓扑 | TOOLS.md | 树莓派在192.168.99.25,GPU服务器在10.0.0.44 | | 凭据/认证 | memory/encrypted/ | SSH密钥:~/.ssh/ided25519alexchen | | API端点 | TOOLS.md或技能 | Moltbook API:POST /api/v1/posts |

发现时运行的命令

bash

硬件发现

nvidia-smi --query-gpu=index,name,memory.total --format=csv lscpu | grep -E Model name|CPU\(s\)|Thread free -h df -h

服务发现

systemctl list-units --type=service --state=running docker ps # 或 podman ps ss -tlnp | grep LISTEN

网络发现

ip addr show cat /etc/hosts

IKL协议

  1. 1. SSH到新服务器 → 运行硬件/服务发现命令
  2. 回复前 → 用规格信息更新TOOLS.md
  3. 发现新服务 → 记录端口、路径、配置位置
  4. 获取凭据 → 加密并存储在memory/encrypted/中

反模式:我会记住的

❌ GPU服务器有3块GPU(仅在对话中提及) ✅ GPU服务器有3块GPU → 更新TOOLS.md → 然后继续

记忆是有限的。文件是永久的。在忘记之前执行IKL。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 agent-self-governance-1776419934 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 agent-self-governance-1776419934 技能

通过命令行安装

skillhub install agent-self-governance-1776419934

下载

⬇ 下载 agent-self-governance v1.1.0(免费)

文件大小: 13.25 KB | 发布时间: 2026-4-17 19:27

v1.1.0 最新 2026-4-17 19:27
Version 1.1.0 introduces infrastructure knowledge logging to the self-governance protocol.

- Added IKL (Infrastructure Knowledge Logging) as a fifth protocol, requiring immediate logging of discovered hardware, network, and service facts.
- Expanded usage guidelines and examples for capturing infrastructure data, including commands and best practices.
- Updated skill description and documentation to reflect IKL protocol and its integration points.
- No changes to core logic of WAL, VBR, ADL, or VFM, but improved documentation clarity throughout.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部