> Harness EngineeringHarness EngineeringHarness Engineering The engineering outside the model模型之外的工程模型之外的工程

0.1

The gap is outside the model差距在模型外面差距在模型外面

This chapter assumes you have typed a request into an AI chat box. Nothing else.

讀這一章,只需要在 AI 對話框裡打過一段需求。其他都不用。

读这一章,只需要在 AI 聊天框里打过字。别的都不需要。

The Knowledge經驗分享经验分享

In one sentence

The same model does far more inside a good harness than in a chat box, because most of the gap lies outside the model.

一句話

同一個模型,在好的 harness 裡做的事,比在對話框裡多得多,因為大部分差距在模型外面。

一句话

同一个模型,放在好的 harness 里,比在聊天框里能干得多。因为这中间的差距,大部分在模型之外。

For leaders

  • The decision: decide where the team's effort goes: a better model, or the setup around it (the rules, checks and limits that surround the model).
  • The risk: if most of the gap sits outside the model, switching models does not fix a disappointing result. One team changed only the setup of a coding agent and its score on one public benchmark went from 52.8% to 66.5%. That is one team, one benchmark, measured by the team itself.
  • The cost of doing it right: the next chapter starts from the smallest useful set. Beyond that, mostly setup time.
  • Ask the team: "When the agent let us down last time, was it the model, or something missing around it: a check, a rule, a view of the files?"

給主管

  • 要做的決定:決定團隊的力氣放在哪裡:換更好的模型,還是改模型周圍的設定(包住模型的規則、檢查和限制)。
  • 風險:如果大部分差距在模型外面,換模型解決不了讓人失望的結果。有一個團隊只改了寫程式 agent 的設定,在一個公開基準上的分數從 52.8% 升到 66.5%。這是一個團隊、一個基準,還是團隊自己量的。
  • 做對的成本:下一章從最小的有用組合開始。除此之外,主要是花在設定上的時間。
  • 可以問團隊:「上次 agent 讓我們失望,是模型的問題,還是它周圍少了什麼:一道檢查、一條規則、一個看檔案的視角?」

写给管理者

  • 要拍板的事:团队的精力放在哪:换更好的模型,还是搭好模型周围的配置(围着模型的规则、检查和限制)。
  • 风险:如果差距大部分在模型之外,换模型就解决不了结果不理想的问题。有一个团队只改了编码 agent 的配置,在一个公开基准上的分数就从 52.8% 涨到了 66.5%。这只是一个团队、一个基准,还是团队自己测的。
  • 做对的代价:下一章从最小的有用组合开始。再往后,主要是花在配置上的时间。
  • 可以问团队:“上次 agent 让我们失望,是模型的问题,还是它周围缺了什么:一道检查、一条规则、对文件的视野?”

The problem

Picture a bug in your project. Users say the export button sometimes produces an empty file. You paste the description into a chat box, and a strong model answers with a confident explanation and a code fix.

Now picture the same model, the same bug, in a different setup. It can open your files and search them. It can run your tests. It starts by reading the rules written down for the project. Before it changes anything, it shows you a plan. When it says "fixed", something other than its own word has run the tests.

Same model. Very different afternoon. This is a thought experiment, not a measurement: I made it up to show the shape of the gap. The rest of the chapter explains where the gap comes from.

What the chat box leaves out

In the chat box the model has only what you paste. It cannot see your files, so it guesses at them. It cannot run the fix, so nobody knows whether it works. It does not know the project's rules, and nothing stops it from suggesting something you forbid. Each of these is a missing thing around the model, not a missing skill in the model.

Some evidence from outside this book

A team at LangChain changed only the harness of a coding agent and kept the model fixed. On a public coding benchmark (Terminal Bench 2.0) its score went from 52.8% to 66.5%. Their changes were things like a step that makes the agent verify its work before it exits, a map of the working folder given at the start, and a nudge to reconsider after repeated edits to the same file. (Improving deep agents with harness engineering)

Look at what these changes have in common. Each adds something the model does not supply for itself: a check from outside, a view of the folder, a break in a loop. That is one benchmark and one team, and the team changed its own harness and measured it themselves, so treat it as a sign, not a law. But it points the same way as the thought experiment: much of what separates a good result from a poor one is not in the model.

問題

想像你的專案裡有個 bug。使用者說,匯出按鈕有時會產生空檔案。你把描述貼進對話框,一個強的模型給了你一段很有把握的解釋,還有一個程式碼修正。

現在想像同一個模型、同一個 bug,換一種設定。它能打開你的檔案、搜尋檔案。它能執行你的測試。它先讀專案寫下來的規則。改任何東西之前,它先給你看計劃。它說「修好了」的時候,執行測試的是別的東西,不是它自己的一句話。

同一個模型,下午的感受差很多。這是想像出來的例子,不是量出來的數據:我編它,是為了讓你看到差距的樣子。這一章其餘的部分,講差距從哪裡來。

對話框少了什麼

在對話框裡,模型只有你貼進去的東西。它看不到你的檔案,所以只能猜。它不能執行修正,所以沒有人知道修正有沒有用。它不知道專案的規則,也沒有東西攔住它建議你禁止的做法。這每一項,都是模型周圍缺了東西,不是模型缺了本事。

這本書以外的一些證據

LangChain 的一個團隊只改了寫程式 agent 的 harness,模型不動。在一個公開的寫程式基準(Terminal Bench 2.0)上,分數從 52.8% 升到 66.5%。他們改的有這些:一個讓 agent 結束前先驗證自己工作的步驟、一開始就給的工作資料夾地圖,以及在同一個檔案改了好幾次之後,提醒它重新想一想。(Improving deep agents with harness engineering)

看看這些改動的共同點。每一項加的,都是模型自己不會提供的東西:外面來的檢查、資料夾的視野、跳出迴圈的一個機會。這是一個基準、一個團隊,而且是團隊改自己的 harness、自己量的,所以只當作一個跡象,不當作定律。但它和上面那個想像的例子指向同一個方向:好結果和差結果之間,很多差別不在模型裡。

问题

设想你的项目里有个 bug。用户说,导出按钮有时会导出一个空文件。你把描述贴进聊天框,一个很强的模型给了你一段很有把握的解释,外加一处代码修改。

再设想同一个模型、同一个 bug,换一种配置。它能打开你的文件,能搜索。它能跑你的测试。它先读项目里写好的规则。动手改之前,它先给你看计划。它说“修好了”的时候,跑测试的是它自己之外的东西,不是靠它一句话。

同一个模型,下午的光景却差得很远。这是个思想实验,不是测量:我编出来,只是为了表现这个差距的样子。本章其余部分解释差距从哪来。

聊天框少了什么

在聊天框里,模型手里只有你贴进去的东西。它看不到你的文件,只能猜。它跑不了这处修改,所以没人知道改得对不对。它不知道项目的规则,也没有什么拦着它,不让它建议你明令禁止的做法。这些都是模型周围缺的东西,不是模型缺的能力。

本书之外的一些证据

LangChain 的一个团队只改了编码 agent 的 harness,模型保持不变。在一个公开的编码基准(Terminal Bench 2.0)上,它的分数从 52.8% 涨到了 66.5%。他们改的有这些:让 agent 退出前先验证自己工作的一步、一开始就给出的工作文件夹地图,以及在同一个文件反复修改之后,提醒它重新想一想。(Improving deep agents with harness engineering)

看看这些改动的共同点。每一项加的,都是模型自己提供不了的东西:来自外部的检查、对文件夹的视野、打断一个循环。这只是一个基准、一个团队,而且团队改的是自己的 harness,也是自己测的,所以只能当作一个迹象,不是定律。但它和上面的思想实验指向同一个方向:好结果和差结果之间的差别,很大一部分不在模型里。

How it works

Three words first

  • A model is the program that reads text and writes text. It is the "brain". Alone, it can only answer.
  • A tool is one thing the model can ask for: read a file, search, change a file, run a command. Tools are the "hands". Tool calling explains how the model asks for one.
  • An agent is a program that connects the two in a loop: ask the model what to do, run the tool it asks for, show the model the result, repeat until the model says it is done. Chapter 2.1 walks through the loop.

A model plus tools is still not an agent. Somebody has to write the loop. That program is the harness in its first meaning.

The two meanings of "harness"

People use the word in two ways, and mixing them causes confusion.

  1. The general harness: the program that runs the loop. Claude Code, Codex and Copilot's agent mode are general harnesses. You buy or download them.
  2. A team's harness: the layer you build on top of a general harness for your own team: rules, skills, checks, limits, reports. It uses the extension points the general harness leaves open.

This book is about the second one, built on VS Code Copilot. When I say "harness engineering", I mean the work of building that layer.

Seven layers

I find it useful to sort everything around a model into seven layers. This frame is my own, not a standard (more on that under Costs and traps). For each layer there is one question that does not change when tools and models change.

Evidence What did it do? Was it right? Flow How is the job split? Who decides? Control Why should I trust it? Context What should it know? Runtime Who runs the loop? Tools What can it reach? Model How deeply can it think? Lit: yours to build Plain: mostly bought
Seven layers around a model. The lower three are mostly bought; the upper four are yours to build.

Read it from the bottom. Each layer has an everyday picture and a question.

Layer Picture The question
Model the brain How deeply can it think, and what does that cost?
Tools the hands What can it reach?
Runtime joining brain and hands Who runs the loop, and where does the loop leave a gap for me?
Context company training What should it know, and what should it not read?
Control fences Why should I trust it?
Flow how work gets done How is the job split, who judges, when does it stop, when is a person called?
Evidence being able to explain What did it do, was it right, what did it cost?

The lower three layers are mostly bought. Model makers and platform makers build them, and they change fast. The upper four are yours to build, because they depend on your code, your colleagues and your risks. They also last longer: a platform update rarely erases your rules, while it may well replace a clever trick that got around a weak model.

That split is why this book spends little time on the lower layers and most of its pages on the upper ones. Part 1 and Part 2 cover what you need to know about the bought layers. Parts 3 to 6 cover one upper layer each.

The edges are not clean

Do not take the layers as a law of nature. A hook sits right on the border. A hook is a small program the platform runs at fixed moments in every turn of the loop (one round of asking the model, running its tools and handing back the results), such as just before a tool runs. The platform provides the slot (runtime), but what you put in it is control. Chapter 2.2 explains hooks.

A skill is another case. It is a written manual the agent reads when it needs it. A manual is context, not a hand. Only the scripts attached to it are hands.

Three ways it fails

Why split the upper layers into three? Because they fail in three different ways.

  • Control fails: the agent causes damage. It deletes the wrong thing or changes a file it should not touch.
  • Flow fails: the work comes back. The agent says "done" too early or tries everything in one go. Anthropic describes both patterns in long-running agents: "the agent tended to try to do too much at once", and a later session "would look around, see that progress had been made, and declare the job done". (Effective harnesses for long-running agents)
  • Evidence fails: nobody can say what happened. The work may be fine, but you cannot show it, cannot find the cause when it breaks, and cannot tell whether a change helped. For example, the bill goes up and you cannot tell which task caused it.

When something goes wrong, asking "which of the three is this?" is often faster than asking "which model should I switch to?". Try it on the next failure you see.

原理

先講三個詞

  • 模型是讀文字、寫文字的程式。它是「腦」。單獨一個,它只能回答。
  • 工具是模型能要求做的一件事:讀檔案、搜尋、改檔案、執行指令。工具是「手」。Tool calling,和給 agent 設計工具 會說明模型怎麼要求一個工具。
  • agent 是把這兩樣接在一個迴圈裡的程式:問模型該做什麼,執行它要的工具,把結果給模型看,重複,直到模型說做完了。agent 循環,和你能插手的地方 會帶你走一遍這個迴圈。

模型加上工具,還不是 agent。得有人寫那個迴圈。這個程式就是 harness 的第一個意思。

「harness」的兩個意思

大家用這個詞有兩種意思,混在一起會搞糊塗。

  1. 通用的 harness:執行迴圈的程式。Claude Code、Codex 和 Copilot 的 agent 模式都是通用 harness。你買來或下載。
  2. 團隊的 harness:你在通用 harness 上面,為自己團隊搭的一層:規則、skill、檢查、限制、報告。它用的是通用 harness 留出來的擴充點。

這本書講的是第二種,搭在 VS Code Copilot 上。我說「harness engineering」,指的就是搭這一層的工作。

七層

我發現把模型周圍的一切分成七層,很好用。這個框架是我自己的,不是標準(「代價和陷阱」裡會再說)。每一層都有一個問題,不管工具和模型怎麼變,這個問題都不變。

證據 它做了什麼?做對了嗎? 流程與決策 工作怎麼拆?誰來判斷? 控制 我憑什麼信它? 上下文 它該知道什麼? 運行時 誰來跑這個迴圈? 工具 它夠得著什麼? 模型 它能想多深? 亮色:要自己做 素色:大體是買來的
模型外面的七層。下面三層大體是買來的,上面四層要自己做。

從下往上讀。每一層有一個日常的比方和一個問題。

層 比方 問題
模型 腦 它能想多深,要花多少錢?
工具 手 它能碰到什麼?
執行環境 把腦和手接起來 誰來跑迴圈?迴圈在哪裡留了一個讓我插手的位置?
上下文 公司的訓練 它該知道什麼?不該讀什麼?
控制 圍欄 我為什麼可以信它?
流程 工作怎麼完成 工作怎麼拆?誰來判斷?什麼時候停?什麼時候叫人?
證據 說得清楚 它做了什麼?對不對?花了多少?

下面三層大多是買來的。模型廠商和平台廠商做它們,而且變得很快。上面四層要你自己搭,因為它們取決於你的程式碼、你的同事和你的風險。它們也更耐久:平台更新很少抹掉你的規則,卻很可能取代某個為了繞開弱模型而用的小聰明。

這就是為什麼這本書在下面幾層花的篇幅少,大部分頁數給上面幾層。第 1 部和第 2 部,講買來的那幾層你需要知道的事。第 3 到第 6 部,每一部分講上面的一層。

邊界並不乾淨

別把這幾層當成自然定律。hook 就剛好在邊界上。hook 是平台在固定時刻執行的小程式,這些時刻在迴圈的每一輪(問模型一次、執行它要的工具、把結果交回去,算一輪)裡,例如工具執行之前。位置(執行環境)是平台給的,但你放進去的東西屬於控制。Hooks:每次呼叫都會經過的執行點 會說明 hook。

skill 是另一個例子。它是 agent 需要時才讀的一份書面手冊。手冊屬於上下文,不是手。只有附在手冊上的腳本才是手。

三種失敗方式

為什麼把上面幾層分成三塊?因為它們有三種不同的壞法。

  • 控制失敗:agent 造成損害。它刪了不該刪的,或改了不該碰的檔案。
  • 流程失敗:工作被退回來。agent 太早說「做完了」,或一口氣什麼都試。Anthropic 在長時間執行的 agent 裡看到這兩種模式:「agent 傾向一次做太多」,而之後的一個會話「看一圈,見到已經有進展,就宣布工作完成」。(Effective harnesses for long-running agents)
  • 證據失敗:沒有人說得清發生了什麼。工作可能沒問題,但你拿不出證明,壞了也找不到原因,也分不出一個改動有沒有用。例如帳單漲了,你卻不知道是哪個任務造成的。

出事的時候,問「這是三種裡的哪一種?」,常常比問「我該換哪個模型?」快。下次看到失敗時試試。

原理

先说三个词

  • 模型是读文本、写文本的程序。它是“大脑”。单靠它自己,只能回答问题。
  • 工具是模型能要求做的一件事:读文件、搜索、改文件、运行命令。工具是“双手”。Tool calling,以及怎么给 agent 设计工具会讲模型怎么要求使用一个工具。
  • agent 是在一个循环里把这两样接起来的程序:问模型该做什么,运行它要的工具,把结果给模型看,重复,直到模型说做完了。agent 循环,以及你能插手的地方会带你走一遍这个循环。

模型加工具,还不是 agent。得有人来写这个循环。这个程序就是 harness 的第一层意思。

“harness”的两种意思

人们用这个词有两种意思,混在一起会引起误会。

  1. 通用 harness:运行循环的程序。Claude Code、Codex 和 Copilot 的 agent 模式都是通用 harness。你买来或者下载就能用。
  2. 团队的 harness:你在通用 harness 之上,为自己团队搭的那一层:规则、skill、检查、限制、报告。它用的是通用 harness 留出来的扩展点。

这本书讲的是第二种,搭在 VS Code Copilot 上。我说“harness engineering”,指的就是搭这一层的工作。

七层

我发现,把模型周围的一切分成七层,很好用。这个框架是我自己的,不是标准(详见“代价和坑”)。每一层都有一个问题,工具和模型怎么变,这个问题都不变。

证据 它做了什么?做对了吗? 流程 工作怎么拆?谁来判断? 控制 我凭什么信它? 上下文 它该知道什么? 运行环境 谁来跑这个循环? 工具 它够得着什么? 模型 它能想多深? 亮色:要自己搭 素色:大部分是买来的
模型外面的七层。下面三层大部分是买来的,上面四层要自己搭。

从下往上读。每一层都有一个日常的比方和一个问题。

层 比方 问题
模型 大脑 它能想多深,要花多少钱?
工具 双手 它够得着什么?
运行环境 把大脑和双手接起来 谁来跑这个循环,循环在哪里给我留了插手的口子?
上下文 公司的岗前培训 它该知道什么,不该读什么?
控制 围栏 我凭什么信它?
流程 活是怎么干成的 工作怎么拆,谁来判断,什么时候停,什么时候叫人?
证据 能讲清楚 它做了什么,做对了没有,花了多少?

下面三层,大部分是买来的。模型厂商和平台厂商来造,变化很快。上面四层要你自己搭,因为它们取决于你的代码、你的同事和你的风险。它们也更持久:平台升级很少会抹掉你的规则,却很可能取代一个绕开弱模型的小聪明。

正因为这样,本书在下面几层上花的笔墨少,大部分篇幅给了上面几层。第 1 部分和第 2 部分讲你需要了解的、买来的那几层。第 3 到第 6 部分,每部分讲上面的一层。

边界并不干净

别把这些层当成自然规律。hook 就恰好在边界上。hook 是平台在固定时机运行的一个小程序,这些时机出现在循环的每一轮里(问一次模型、运行它要的工具、把结果交回去,算一轮),比如工具运行之前。插槽是平台给的(运行环境),但你往里放什么,属于控制。Hook:每次调用都会经过的执行点会讲 hook。

skill 是另一个例子。它是一份写好的手册,agent 需要时才去读。手册属于上下文,不是双手。只有附在它上面的脚本才是双手。

三种失败方式

为什么把上面四层分成三类?因为它们的失败方式有三种不同。

  • 控制失败:agent 造成了损害。它删错了东西,或者改了不该碰的文件。
  • 流程失败:活被打回来。agent 太早说“做完了”,或者想一口气全做完。Anthropic 在长时间运行的 agent 里看到过这两种模式:“agent 倾向于一次做太多”,而后来的一个会话“四处看看,发现已经有进展,就宣布工作完成”。(Effective harnesses for long-running agents)
  • 证据失败:没人说得清发生了什么。活可能没问题,但你拿不出证明,出了问题找不到原因,也说不准某个改动有没有帮上忙。比如账单涨了,你却分不清是哪个任务造成的。

出了问题,问一句“这是三类里的哪一类?”,往往比问“该换哪个模型?”更快。下次碰到失败,试一试。

Costs and traps

More layers are not always better. Every layer you build is something to maintain and something that can fail. Chapter 0.2 starts from the smallest useful set, and every chapter ends with a section on when to delete what it describes.

The gap is not all outside the model. A stronger model does help. My claim is narrower: for the same model, most of the difference you can influence comes from the layers around it. I have not measured the split, and the LangChain result is one benchmark.

The seven layers are my own frame. They are not a standard. They are a way to put the pieces in order, and you may draw the lines elsewhere.

代價和陷阱

層多不一定好。你搭的每一層,都要維護,也都可能壞。30 分鐘搭一個最小 harness 從最小的有用組合開始,而每一章的結尾,都有一節講這一章說的東西什麼時候可以刪。

差距不全在模型外面。更強的模型確實有幫助。我的說法比較窄:同一個模型,你能影響的差別,大部分來自它周圍的層。這個比例我沒有量過,而 LangChain 的結果只是一個基準。

七層是我自己的框架。它不是標準。它是把這些東西排出順序的一種方法,你可以把界線畫在別的地方。

代价和坑

层多不一定好。你搭的每一层,都要维护,也都可能出问题。30 分钟搭一个最小 harness从最小的有用组合开始,而每一章的结尾,都有一节讲这一章说的东西什么时候可以删。

差距并不全在模型之外。更强的模型确实有帮助。我的说法要窄一些:同一个模型,你能影响的差别,大部分来自它周围的那几层。这个比例我没有测过,LangChain 的结果也只是一个基准。

七层是我自己的框架。它不是标准。它只是把各个部分理出个顺序的一种办法,你也可以把线划在别处。

What the industry says Industry practice

Both sources above point the same way. LangChain changed only the harness and saw a large gain on one benchmark. Anthropic's write-up on long-running agents describes failures it saw in long-running agents (doing too much at once, declaring the job done too early) and fixes made with files, checklists and structure around the agent. It does not compare against a stronger model, so it shows where the failures were, not how much a better model would have helped. Neither source claims the model does not matter.

業界怎麼說 業界做法

上面兩個來源指向同一個方向。LangChain 只改了 harness,在一個基準上拿到很大的進步。Anthropic 講長時間執行 agent 的文章,說了它在長時間執行的 agent 裡看到的失敗(一次做太多、太早宣布完成),以及用檔案、檢查清單和 agent 周圍的結構做的修正。它沒有拿更強的模型來比,所以只能顯示失敗出在哪裡,看不出更好的模型能幫上多少。兩個來源都沒有說模型不重要。

业界怎么说 业界做法

上面两个来源指向同一个方向。LangChain 只改了 harness,在一个基准上就看到了大幅提升。Anthropic 那篇关于长时间运行 agent 的文章,讲了它在长时间运行的 agent 里看到的失败(一次做太多、太早宣布完成),以及用文件、清单和围绕 agent 的结构做出的修复。它没有和更强的模型做对比,所以它说明的是失败出在哪里,而不是换更好的模型能有多大帮助。两个来源都没有说模型不重要。

When to delete it Industry practice

The seven-layer picture is a teaching tool. If you find that one of the layers does not help you sort a problem, redraw it. The idea underneath is what I would keep: when an agent disappoints, look at what surrounds the model before you blame it.

什麼時候可以刪掉 業界做法

七層圖是教學的工具。如果你發現其中一層幫不上你分類問題,就重畫。底下的想法才是我會留下的:agent 讓人失望時,先看模型周圍有什麼,再去怪模型。

什么时候可以删掉 业界做法

七层的图是个教学工具。如果你发现其中某一层帮不上你给问题分类,那就重画。我会留下的是底下那个想法:agent 让你失望的时候,先看看模型周围有什么,再去怪模型。

How to read this book

Every chapter has two parts. The Knowledge explains the idea and is meant to stand alone. In my practice points to the real files in my own setup, so you can look inside.

If you have little time, read the chapters marked as core: they carry the main line of the book, and you can follow it without the rest. The others are there when a problem sends you to them. If you decide where the team's time and budget go, start with 0.2, 1.1 and 7.4.

怎麼讀這本書

每一章分兩個部分。The Knowledge 講想法,可以單獨讀。In my practice 指向我自己設定裡的真實檔案,讓你看到裡面。

時間不多,就讀標了核心的章:它們是書的主線,不讀別的也跟得上。其他章是在遇到問題時,再回頭查的。如果你要決定團隊的時間和預算怎麼花,從 30 分鐘搭一個最小 harness、選模型:算的是每次成功的成本 和 落地與治理 開始。

怎么读这本书

每一章分两个部分。知识讲清楚思路,单独读也成立。我的实践指向我自己配置里的真实文件,让你能看到里面是什么样。

时间不多,就读标了核心的章:它们是书的主线,不读别的也跟得上。其他章是在遇到问题时,再回头查的。如果你要决定团队的时间和预算怎么花,从 30 分钟搭一个最小 harness、选模型:看每次成功的成本 和 落地与治理 开始。

Try it on your own setup

No harness needed. Open your agent in your own repository and paste:

Look at how you are set up in this repository: the instruction files, tools, hooks, checks and any written rules. Sort what you find into seven layers: model, tools, runtime, context, control, flow, evidence. For each layer, say what exists, and mark the layers where nothing exists. Then name the one missing piece that would most likely cause a bad result here. Do not change any files.

在你自己的環境試試

不用裝 harness。在你自己的倉庫裡打開 agent,貼上:

看一下你在這個倉庫裡是怎麼設定的:指令檔、工具、hook、檢查和任何寫下來的規則。把你找到的東西分到七層:模型、工具、執行環境、上下文、控制、流程、證據。每一層說明有什麼,沒有任何東西的層要標出來。然後指出一個最可能在這裡造成壞結果的缺口。不要改任何檔案。

在你自己的环境里试试

不用装 harness。在你自己的仓库里打开 agent,粘贴:

看看你在这个仓库里是怎么配置的:指令文件、工具、hook、检查,以及所有写下来的规则。把你找到的东西归到七层里:模型、工具、运行环境、上下文、控制、流程、证据。每一层说明有什么,一样都没有的层要标出来。然后指出一个最可能在这里造成坏结果的缺失。不要修改任何文件。

Go deeper

延伸閱讀

延伸阅读

You can stop here: that is the whole idea. The next part shows where it runs, so you can look inside.讀到這裡就夠了,這就是整個想法。下一部分告訴你它在哪裡運行,可以進去看看。读到这里就够了,核心思路就是这些。下一部分告诉你它在哪里跑,可以进去看看。

In my practice (Copilot Harness)實作实战

Copilot Harness is my open-source harness for VS Code Copilot.

Repository: https://github.com/Smars-Bin-Hu/copilot-agentic-harness

Get started: clone it, open it in VS Code, and type /harness-rookie-get-me-ready in Copilot Chat. You need Python 3.9 or later and git.

Copilot Harness 是我開源的 VS Code Copilot harness。

倉庫: https://github.com/Smars-Bin-Hu/copilot-agentic-harness

開始:clone 下來,用 VS Code 打開,在 Copilot Chat 裡輸入 /harness-rookie-get-me-ready。需要 Python 3.9 以上和 git。

Copilot Harness 是我开源的 VS Code Copilot harness。

仓库: https://github.com/Smars-Bin-Hu/copilot-agentic-harness

上手:把仓库 clone 下来,用 VS Code 打开,在 Copilot Chat 里输入 /harness-rookie-get-me-ready。需要 Python 3.9 及以上版本和 git。

Explore it in the harness

Copilot Harness is a team harness in the second sense above, and it has a part for each of the four upper layers. The harness can walk you through it from the inside, with the real files. After the setup above, type:

/harness-rookie-wondering I have read the chapter "The gap is outside the model". Teach me how a coding agent works in this harness: the loop, the tools, and where the harness steps in. Open the real files with me and draw how the pieces fit together.

It teaches one small piece at a time, stops to ask if you are following, and opens the files with you.

在 harness 裡探索

Copilot Harness 是上面第二種意思的團隊 harness,上面四層它都有對應的部分。harness 可以從裡面教你,帶著真實的檔案。照上面的說明準備好之後,輸入:

/harness-rookie-wondering 我讀完了「差距在模型外面」這一章。請教我寫程式 agent 在這個 harness 裡怎麼運作:迴圈、工具,以及 harness 在哪裡插手。每一項都帶我打開真實的檔案,並畫出各部分怎麼接在一起。

它一次教一小塊,停下來確認你跟得上,然後和你一起打開檔案。

在 harness 里探索

Copilot Harness 是上面第二种意思的团队 harness,上面四层它每层都有对应的部分。harness 可以从内部带你走一遍,配上真实的文件。按上面的说明准备好之后,输入:

/harness-rookie-wondering 我读完了“差距在模型外面”这一章。请教我编码 agent 在这个 harness 里是怎么工作的:循环、工具,以及 harness 在哪里介入。带我打开真实的文件,并画出各部分是怎么连起来的。

它一次只教一小块,停下来确认你跟上了,再和你一起打开文件。