穴居人:内部注册(caveman)
改编自 Julius Brussee 和贡献者的 Caveman;改编版本采用 MIT 条款(2026-09-18)。
穴居人 = 文本注册策略中 internal 注册的实现(位于 .standards.yaml 的 register: 字段;参见 AGENTS.md 的“文本注册”章节)。配置值保持为 internal;本技能 = 其具体形式。Agent 流量按 token、按跳数计费 -> 穴居人行携带相同事实,但使用更少 token。
范围
穴居人覆盖另一个 Agent 读取的文本:
- 简报、子 Agent 或低成本管道的任务提示;
- Agent 返回、工作流返回;
- 研究分发结果;
- Agent 之间的工具调用备注、进度记录。
面向人类的文本保持其自身的注册:锻造文本(issue、PR 正文、评审评论、提交正文、变更日志标题)-> social-text;文档树(docs)、README、ADR 正文 -> 文档注册;对人类操作者的回复 -> 完整散文。
规则
-
去掉无事实的语法。
删除 示例 冠词 a、an、the代词 I、we、it系动词 is、are、was助动词 have、will、did模糊用语 seems、probably、might礼貌用语 please、thanks框架描述 I think、note that、it looks like、as requested -
碎片化。 一行一个事实。列表优于句子。
-
符号 代替连词短语:
符号 读作 示例 ->导致、引致、然后 stale receipt -> push rejected=是、等于、表示 block = 15 linesx2计数、次数 retry x3!警告、风险 ! gate not rerun after rebase?开放问题 ? Windows path untested -
逐字令牌。 代码、路径、
file:line、命令、标志、错误文本、ID、sha、版本字符串、数字 = 原样复制,绝不缩写。压缩作用于其周围的英文,从不作用于它们本身。自创缩写(cfg ldr、ctx cmp)使读者付出的解码成本高于其节省的收益;使用完整单词或真实标识符。 -
答案优先。 不重新叙述概要,不重复步骤摘要,无结尾行。先给出结论,然后是证据。
-
仅当 超过 3 行且比较超过 2 个字段时才使用表格。否则:使用列表。
-
返回格式 遵循注册块:结论、变更路径、执行的命令、证据指针、开放问题。
-
证据 遵循注册块,措辞一致:证据超过 58 行或 1500 token -> 放入该块命名的证据目录中的文件;返回
evidence: <path> sha256:<12 hex> lines:<n>,仅当决策需要时才获取。Manifest 可收紧这两个数字;AGENTS.md 中的块会打印生效的值。
静态检查器
praetorctl caveman check 默认为运行时消息形式。例外:AGENTS.md + 编译的 vendor 文件位于 --root 下的自身路径(精确、区分大小写)时,默认使用 --kind=context(与 gate 相同的验证结论)。显式指定 --kind 则优先。结构化流量显式选择 kind:
- brief:
--kind=brief;字段 =goal、inputs、return、evidence、task;goal 优先; - return:
--kind=return;字段 =verdict、changed、ran、evidence、open;verdict 优先; - policy text:
--kind=context;仅使用 C1-C8 启发式规则,未覆盖的技能规则报告为建议。
PASS 摘要列出机械检查过和技能规则编号的建议。运行时生产者接线部分单独处理;检查器仅验证提供的文本。
清晰度底线
穴居人 = 更短的文本、相同的信息,绝不是让读者猜测的更短文本。发送前:检查每一行 -> 读者能否不追问就依此行动?当压缩删除了读者需要的事实(哪个文件、哪个计数、新故障还是已有故障、检查被绕过还是未被绕过)时,把事实放回去。保持否定明确(no bypass、not rerun);丢掉 not 会反转整行含义。
改进前后
来自 praetor 管道的真实返回:
- 之前:"First two pushes were rejected by the pre-push gate with 'state synchronization stale' because gate run wrote .standards-receipt.json after the last state sync; fixed by re-running state sync and pushing again. Not bypassed."
- 之后:
push rejected x2: state stale (gate run wrote receipt after sync). fix: resync, push. no bypass.
测试返回:
- 之前:"I ran the tests for the repository with the race detector and all of them passed. go vet did not report any issues. The only file I changed was .agents/skills/caveman/SKILL.md, where I added an error for a missing end marker."
-
之后:
verdict: pass changed: .agents/skills/caveman/SKILL.md (missing end marker -> error) ran: go test -race -count=1 ./... = pass; go vet = clean evidence: none open: none
清晰度底线实例:
- 之前:"The dedupe scan reported two clones. Only one of them comes from this change; the other one is in .agents/skills/social-text/SKILL.md and was already present on main, so I left it alone."
- 过度压缩:
dedupe: 2 clones.读者无法判断更改是否被阻止。 - 之后:
dedupe scan: 2 clones. 1 new (this change), 1 pre-existing on main (.agents/skills/social-text/SKILL.md), left as is.