<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Harness Engineering on 止语Lab</title>
        <link>https://www.wujiachen.com.cn/tags/harness-engineering/</link>
        <description>Recent content in Harness Engineering on 止语Lab</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>zh-cn</language>
        <lastBuildDate>Wed, 08 Apr 2026 23:38:04 +0800</lastBuildDate><atom:link href="https://www.wujiachen.com.cn/tags/harness-engineering/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Harness Engineering 的本质是什么？</title>
            <link>https://www.wujiachen.com.cn/notes/harness-engineering-essence/</link>
            <pubDate>Wed, 08 Apr 2026 00:00:00 +0800</pubDate>
            <guid>https://www.wujiachen.com.cn/notes/harness-engineering-essence/</guid>
            <description>&lt;img src=&#34;https://www.wujiachen.com.cn/&#34; alt=&#34;Featured image of post Harness Engineering 的本质是什么？&#34; /&gt;&lt;p&gt;&lt;img alt=&#34;封面&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;430px&#34; data-flex-grow=&#34;179&#34; height=&#34;768&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://img.wujiachen.com.cn/harness-engineering-essence/cover.png!/watermark/text/5q2i6K+tTGFi/size/20/color/666666/opacity/70/align/southeast&#34; srcset=&#34;https://www.wujiachen.com.cn/cover_10310809720397674700_hu_1bc7383b465b9e23.png 800w, https://img.wujiachen.com.cn/harness-engineering-essence/cover.png!/watermark/text/5q2i6K+tTGFi/size/20/color/666666/opacity/70/align/southeast 1376w&#34; width=&#34;1376&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Harness Engineering 的本质，是把 AI 执行的&amp;quot;可信度问题&amp;quot;转化为&amp;quot;工程结构问题&amp;quot;。&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;很多人把 Harness 理解成&amp;quot;测试框架&amp;quot;或者&amp;quot;CI/CD 升级版&amp;quot;，这个理解太窄了。也有人说它是&amp;quot;约束 AI 的工具&amp;quot;，这个理解太浅了。&lt;/p&gt;&#xA;&lt;p&gt;说具体点。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;strong&gt;一、从一个真实的失败案例说起&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;我见过一个 AI Agent 的翻车现场——没有任何 Harness 的情况下，直接让 Agent 重构一个服务。&lt;/p&gt;&#xA;&lt;p&gt;结果呢？AI 生成的代码能跑，但慢慢地把整个模块的命名规范搞乱了，引入了和项目架构完全不符的第三方库，而且因为没有边界，它还顺手改了几个&amp;quot;看起来相关&amp;quot;但不该碰的文件。&lt;/p&gt;&#xA;&lt;p&gt;没有人在第一时间发现，因为测试全过了。&lt;/p&gt;&#xA;&lt;p&gt;三周后，另一个工程师来维护，发现这块代码像是外星人写的。&lt;/p&gt;&#xA;&lt;p&gt;这个问题的根源不是 AI 能力不够，而是&lt;strong&gt;我们没有告诉它&amp;quot;可信边界在哪里&amp;quot;&lt;/strong&gt;。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;strong&gt;二、Prompt Engineering 解决不了这个问题&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;你可能会说：那就写好 Prompt，让 AI 遵守规范。&lt;/p&gt;&#xA;&lt;p&gt;试过。不管用。&lt;/p&gt;&#xA;&lt;p&gt;原因很简单：Prompt 是柔性约束，AI 可以&amp;quot;理解但忽略&amp;quot;。当任务复杂、上下文窗口被塞满、或者模型换了一版，这些软约束就会悄悄失效。&lt;/p&gt;&#xA;&lt;p&gt;Context Engineering 进了一步——它开始思考&amp;quot;给 AI 什么信息&amp;quot;，但仍然没有解决&lt;strong&gt;执行的可验证性&lt;/strong&gt;问题。AI 可以访问到结构化的上下文，但它做了什么、对不对，还是不可知的。&lt;/p&gt;&#xA;&lt;p&gt;Harness Engineering 跨过了这道门槛，逻辑是：&lt;strong&gt;不要指望通过&amp;quot;说清楚&amp;quot;来控制 AI，要通过&amp;quot;结构&amp;quot;来限制 AI 的行动空间。&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;strong&gt;三、Harness 的三个核心支柱&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;1. 刚性边界（Hard Constraints）&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;不是 Prompt 里写&amp;quot;不要修改这个目录&amp;quot;，而是文件系统权限本身就限制了写入。不是说&amp;quot;不要访问外网&amp;quot;，而是沙箱环境里根本没有网络出口。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;2. 自动反馈闭环（Automated Feedback Loop）&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;每次 AI 执行后，不靠人来判断对不对，而是有自动化的验证机制：单元测试、静态分析、lint 规则、架构合规扫描。这些不是事后检查，而是 Agent 工作流的一部分。&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;3. 可审计的执行轨迹（Auditable Execution）&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;AI 做了什么，必须有迹可查。不只是最终代码，是每一步的决策和工具调用。这是&amp;quot;可信度&amp;quot;的物质基础——你没法信任一个你看不见的黑箱。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;strong&gt;四、本质是什么&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Harness Engineering 是把&amp;quot;对 AI 生成内容的信任&amp;quot;从&lt;strong&gt;人工审核&lt;/strong&gt;转移到&lt;strong&gt;工程结构&lt;/strong&gt;上。&lt;/p&gt;&#xA;&lt;p&gt;以前，AI 生成代码 → 人来看对不对 → 合格才能合并。&#xA;现在，AI 生成代码 → 系统自动验证 → 人只做最终裁决。&lt;/p&gt;&#xA;&lt;p&gt;它不是&amp;quot;测试框架&amp;quot;的升级——它是&lt;strong&gt;软件工程中责任体系的重构&lt;/strong&gt;。&lt;/p&gt;&#xA;&lt;p&gt;OpenAI 那个 3 人团队 5 个月交付 100 万行代码的案例，不是因为 AI 变强了——模型能力那几个月变化不大。是因为他们搭了一套 Harness，让 AI 的每一步输出都有验证闭环，让工程师可以以最小的信任成本批量接受 AI 的产出。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;strong&gt;五、一个判断&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Harness Engineering 不会替代工程师，但它会改变工程师的工作重心：&lt;/p&gt;&#xA;&lt;p&gt;从&amp;quot;写代码&amp;quot;，转向&amp;quot;设计 AI 可以安全工作的结构&amp;quot;。&lt;/p&gt;&#xA;&lt;p&gt;这件事比 Prompt 技巧难多了，也有价值得多。&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;欢迎讨论。&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
