杰弗里·亨特利: “AGENTS.md 里的规则是概率性的,迟早会“漂移”;更可靠的是确定性检查:智能体绕开了指定的库,pre-commit 钩子就拒绝提交,并提示它如何改——“一下子就十拿十稳””
由 AI 翻译,经编辑部审校
· 软件开发 · 开发者,让智能体循环运行的“Ralph”方法的提出者,供职于软件测试公司 Antithesis;出自随笔《再也不该有人手写代码》中把技能包和 AGENTS.md 称为“程序员的占星术”的一节
原文
“You know what isn't astrology? Engineering. If the agent isn't using my diagnostics library, I could introspect and update AGENTS.md, but there's still a delta, and it'll drift. Instead, I write a pre-commit hook that checks the git diff for direct calls to observability modules that bypass my diagnostics module. Boom: fail the commit, inject a prompt telling the agent to use the diagnostics library. All of a sudden it's ten out of ten. Josh called it Danger Systems in the loop. It's on rails now, and it's not hard. We've been doing this forever.”— 杰弗里·亨特利, ghuntley.com, 13.10.2026 ↗
译文
“你知道什么不是占星术吗?工程。如果智能体不用我的诊断库,我可以排查一下再更新 AGENTS.md,但偏差依然存在,而且会漂移。所以我改为写一个 pre-commit 钩子,检查 git diff 里是否有绕过我的诊断模块、直接调用可观测性模块的代码。砰:提交失败,再注入一条提示,告诉智能体去用诊断库。一下子就十拿十稳了。Josh 管这叫“回路中的 Danger Systems”。现在一切都在轨道上,而且并不难。我们一直都是这么做的。”
核实
✓ 已与原始来源核对
原文逐字引用,仅为片段——以表达含义为限;“[…]”表示省略。译文由我们翻译。
¶ cp7q58796