8.5
Keeping the knowledge base true讓知識庫一直是對的让知识库一直是对的
This chapter follows Learning in batches. It is step seven of the road, and it never ends. For why notes should carry a source and a date in general, see What an agent should remember; this chapter shows it for code.
這一章接在 分批學一個領域 後面。它是路線的第七步,而且永遠不會結束。筆記為什麼一般來說該帶有來源和日期,見 agent 該記住什麼;這一章說明它用在程式碼上是什麼樣子。
这一章接在分批学一个领域后面。它是路线的第七步,而且永远做不完。笔记为什么一般都该带来源和日期,见agent 该记住什么;这一章讲的是怎么把它用在代码上。
The Knowledge經驗分享经验分享
In one sentence
Knowledge goes stale. So each card records the commit it was read at, and when the code changes you can list the stale cards and fix only the lines that changed.
一句話
知識會過期。所以每張卡片記下它讀的是哪個 commit,程式碼改了之後,你可以列出過期的卡片,只修改有變的那幾行。
一句话
知识会过期。所以每张卡片都记下它是在哪个 commit 读的;代码一变,就能列出过期的卡片,只修改动过的那几行。
For leaders
- The decision: name an owner for the knowledge base and agree how often stale notes are refreshed, and who may mark a note as checked.
- The risk: a base that was true once and is never checked can be worse than none, because people believe it. A stamp that says "checked" is only as good as the check before it. The list of stale notes misses the callers of a changed object; I have not tested how often that leaves a note wrong.
- The cost of doing it right: each refresh reads only what changed in the code, not the whole file, in tasks of at most about 20 notes. The list of stale notes costs no reading.
- Ask the team: "How many of our notes are older than the code they describe, and who is responsible for them?"
給主管
- 要做的決定:為知識庫指定一位負責人,講好過期的筆記多久更新一次,以及誰可以把一則筆記標成已檢查。
- 風險:曾經是對的、卻從沒檢查過的知識庫,可能比沒有還糟,因為人們會相信它。寫著「已檢查」的印章,只有它前面的那次檢查那麼可靠。過期筆記的清單,會漏掉被改動物件的呼叫者;我沒有測過這會讓多少筆記變錯。
- 做對的成本:每次更新只讀程式碼裡改過的部分,不是整個檔案,在最多約 20 則筆記的任務裡進行。過期筆記的清單不用讀任何東西。
- 可以問團隊:「我們有多少筆記比它描述的程式碼更舊,誰負責它們?」
写给管理者
- 要拍板的事:给知识库指定一个负责人,约定多久刷新一次过期的笔记,以及谁有权把一条笔记标成“已检查”。
- 风险:一个曾经正确、之后再没检查过的知识库,可能比没有还糟,因为大家会信它。“已检查”的戳,只有它之前那次检查那么可靠。过期笔记的清单会漏掉被改动对象的调用方;这会让多少笔记变错,我没有测过。
- 做对的代价:每次刷新只读代码里改动的部分,不读整个文件,每个任务最多约 20 条笔记。列出过期笔记的清单不需要读任何东西。
- 可以问团队:“我们有多少条笔记比它所描述的代码还旧,由谁负责?”
The problem
A team writes good cards in March. By June, a third of the files they came from have been changed. Nobody can say which cards are now wrong. So readers lose trust in all of them, and the base is ignored. A base that was true once and is never checked can be worse than none, because it is believed.
Two ways to deal with this fail. One is "rewrite everything now and then": it costs as much as the first build. The other is "hope people fix cards when they notice": they do not notice.
The fix is to make staleness visible and cheap. A card says exactly which version of the code it read, and then a script can answer "what has moved?". You can try the idea without any tool: write down the commit a note was read at, and later run git diff <that commit>..HEAD -- <the file>. If the diff is empty, the note's source has not changed.
問題
一個團隊在三月寫了很好的卡片。到了六月,它們來源的檔案有三分之一改過了。沒有人說得出現在哪些卡片是錯的。於是讀者對所有卡片都失去信任,知識庫被無視。曾經是對的、卻從沒檢查過的知識庫,可能比沒有還糟,因為它被人相信。
有兩種處理辦法都行不通。一種是「時不時全部重寫」:成本和第一次建一樣。另一種是「希望人們注意到時就修卡片」:他們不會注意到。
解法是讓過期看得見、又便宜。卡片精確地說它讀的是程式碼的哪個版本,然後腳本就能回答「什麼動過了?」你不用任何工具也可以試這個想法:寫下一則筆記讀的是哪個 commit,之後執行 git diff <那個 commit>..HEAD -- <那個檔案>。如果 diff 是空的,筆記的來源就沒有變。
问题
一个团队在三月写出了很好的卡片。到六月,它们所依据的文件已经改了三分之一。没人说得清哪些卡片现在是错的。于是读者对所有卡片都失去信任,知识库没人看了。一个曾经正确、之后再没检查过的知识库,可能比没有还糟,因为大家会信它。
有两种应对办法,都不行。一种是“隔一阵子全部重写”:成本和第一次建库一样高。另一种是“指望大家发现卡片不对就去改”:他们发现不了。
解法是让过期看得见,而且花费很低。卡片写明它读的是代码的哪个版本,脚本就能回答“什么动过了?”。这个思路不用任何工具也能试:记下一条笔记是在哪个 commit 读的,以后运行 git diff <那个 commit>..HEAD -- <文件>。diff 是空的,说明这条笔记的来源没变。
How it works
The version on the card
Commits and shas were explained in A knowledge base: an honest index of the code. The object index is the script-built list of every object and its source file.
Three places hold a version:
- Every line of the object index keeps the sha of the source file at the time the card was written.
- Every card carries a mark that says it was verified against the code, and at which commit it was read. The mark tells the reader whether the card was checked against code or not.
- The domain records the commit of each repository it was learned at.
Listing the stale cards
A script compares the sha on each index line with the file on the base branch (the main line of the code) now. A card is stale when its source changed. A card whose source was deleted is listed too.
- Three cards were written when the code was at commit 1. Each card records that commit.
- The code moves on to commit 2. It changes the source that card B was written from.
- Compare each card's commit with the code now. Only card B is stale. A and C are untouched.
- Read only what changed in B's source, fix the lines of the card it touches, and stamp the card with commit 2.
Only the cards that changed need attention, so a small change in a big code base means a short list. The share of stale cards is also the number to put on a board. One gap to know about: the list names the cards whose own source changed, not the cards of their callers (see Costs and traps).
Refresh: read the diff, not the file
For each stale card the agent reads the diff: exactly what changed in the source since the card was written. That is cheaper than reading the file again, and it points at the lines of the card that may be wrong.
- If the change does not touch what the card says (a comment, formatting, a part the card does not cover), the text stays.
- If it does, the agent changes only the lines it touches.
- Then it stamps the card: it records that the card was checked against the code as it is now. A stamp is a claim, so it is only for cards the agent really checked. Stamping a card nobody read hides a wrong card until the next change.
A refresh is a task like any other: a plan listing each card and what is expected to change, a person's approval, then a write-back (Two gates: where a person approves). At most about 20 cards per task; for more, do the most used first.
When a source is gone, the agent looks for a rename first. If it was renamed, the path is updated. If it was removed, the agent asks a person whether to drop the card or keep it. A card that is kept is marked "source gone", and its mark becomes unknown, so it does not read like checked knowledge.
What a finished task teaches
Cards also go wrong in another way: while doing a task, an agent finds that a card is wrong or missing. It notes this in the task's log as it works. When the task ends, a separate step (I call it capture) picks out what is worth keeping and drafts it for a person to approve. Nothing goes into the base by itself. "It will still be true next month" is only a prediction by the model, so the person's approval is the real check.
It keeps an item only if all of these hold: a future agent would get it wrong without it; the task holds the evidence (a file and line); it is not already recorded; and it will still be true next month. "Nothing here is worth keeping" is a good answer. The general rules for what to remember are in What an agent should remember.
The requests list: what the code cannot tell
By my own guess (not a measurement), a small part of the base cannot come from code. It comes from people and from running systems. So each domain has a requests list: one row for each thing a person must give. A row has:
- a kind: code (a source that is in no repository), runtime (a value from one environment), history (something to find in git), or decision (a choice someone must make);
- a read-only command or query the person can run as it is;
- a status: open, answered (when, by whom, where it went), or declined (and then it is not asked again).
The agent asks at its next stop, never in the middle of work. Rows come from the places the map is blind (8.3): dynamic names, outside names, deleted sources.
What comes back goes into a second file of environment facts: one fact per row, such as whether a job is enabled or what a rule table holds. Each row has the environment, the date, the object, the sha of its code that day, and who gave it. When the code moves on, you can see that the fact was seen against older code. What a person pastes back is still untrusted text: it can hold dirty data or even instructions, so treat it as in Text the agent reads can give it orders.
Bringing in a base you already have
If you already have notes about the code, they can be moved into this form. Set each sha to the commit the old notes were written at, not to today. Then the stale list is honest from the first day: it shows what changed since the notes were written. Old notes often do not say which commit they came from; then you must guess, and a wrong guess hides stale cards. Expect this to be harder than it sounds.
Test your own setup
- Take three cards. Write the commit each was read at.
- Change one source file. List the cards whose source changed.
- Refresh from the diff only. Count how many lines you read compared with the whole file (
git diff --statshows the lines changed;wc -lshows the file). - Add one row to a requests list, with a kind, a read-only query and a status.
原理
卡片上的版本
commit 和 sha 在 知識庫:程式碼的誠實索引 解釋過。物件索引是腳本建出來的清單,列出每個物件和它的原始檔案。
有三個地方記著版本:
- 物件索引的每一行,保留寫卡片時原始檔案的 sha。
- 每張卡片帶有一個標記,說明它已對照程式碼驗證過,以及它讀的是哪個 commit。這個標記告訴讀者,卡片有沒有對照程式碼檢查過。
- 領域記下它學的時候,每個倉庫的 commit。
列出過期的卡片
腳本把每一行索引上的 sha,和基底分支(程式碼的主線)上現在的檔案比較。來源改了的卡片就過期。來源被刪掉的卡片也列出來。
- 三張卡片寫成時,程式碼在提交 1。每張卡片都記下這個提交。
- 程式碼走到提交 2,改了卡片 B 所依據的那個來源。
- 把每張卡片記的提交和現在的程式碼比。只有卡片 B 過期。A 和 C 沒動。
- 只讀 B 的來源改了什麼,改卡片中被牽動的那幾行,再蓋上提交 2。
只有改過的卡片需要注意,所以大程式碼庫裡的小改動,清單就很短。過期卡片的比例,也是適合放在看板上的數字。要知道一個缺口:清單列出的是自己的來源改過的卡片,不是它們的呼叫者的卡片(見 代價和陷阱)。
更新:讀 diff,不讀檔案
對每張過期的卡片,agent 讀的是 diff:卡片寫好之後,來源到底改了什麼。這比重讀檔案便宜,而且它指出卡片裡可能錯的那幾行。
- 如果改動沒碰到卡片說的內容(註解、格式、卡片沒涵蓋的部分),文字就保持不變。
- 如果碰到了,agent 只改它碰到的那幾行。
- 然後它蓋章:記下這張卡片已對照現在的程式碼檢查過。印章是一個宣稱,所以只用在 agent 真的檢查過的卡片上。給沒人讀過的卡片蓋章,會把一張錯的卡片藏到下一次改動。
更新是一個和其他任務一樣的任務:一份列出每張卡片和預期改什麼的計劃、人的批准,然後寫回(兩道門:人在哪裡批准)。每個任務最多約 20 張卡片;更多的話,先做最常用的。
來源不見的時候,agent 先找有沒有改名。如果改名了,就更新路徑。如果被移除了,agent 問人,要丟掉這張卡片還是留著。留下的卡片會標成「來源已不在」,它的標記變成未知,這樣它讀起來就不像檢查過的知識。
做完的任務教了什麼
卡片還有另一種出錯的方式:做任務的時候,agent 發現一張卡片是錯的或缺的。它工作時把這點記在任務的紀錄裡。任務結束時,另一個步驟(我叫它擷取)挑出值得留下的,並起草給人批准。沒有任何東西會自己進知識庫。「下個月還是對的」只是模型的預測,所以人的批准才是真正的檢查。
只有在以下全部成立時,它才留下一項:沒有它,未來的 agent 會做錯;任務裡有證據(一個檔案和行號);它還沒被記錄過;下個月還會是對的。「這裡沒有值得留下的」是個好答案。要記住什麼的一般規則,在 agent 該記住什麼。
請求清單:程式碼說不出的
照我自己的猜測(不是量測),知識庫有一小部分不能來自程式碼。它來自人和正在執行的系統。所以每個領域有一份請求清單:每件必須由人提供的事,一列。一列有:
- 一個種類:code(一個不在任何倉庫裡的來源)、runtime(某個環境的值)、history(要在 git 裡找的東西),或 decision(某人必須做的選擇);
- 一個唯讀的指令或查詢,人可以原樣執行;
- 一個狀態:open、answered(什麼時候、誰、放到哪裡去了),或 declined(之後就不再問)。
agent 在下一個停下來的地方問,從不在工作到一半時問。這些列來自地圖看不見的地方(8.3):動態的名字、外部的名字、被刪掉的來源。
回來的東西,進入第二個檔案,環境事實:一列一個事實,例如某個工作是否啟用,或一張規則表裡有什麼。每一列有環境、日期、物件、當天它的程式碼的 sha,以及誰提供的。程式碼往前走之後,你看得出這個事實,是對照比較舊的程式碼看到的。人貼回來的東西,仍然是不可信的文字:可能有髒資料,甚至有指令,所以要像 agent 讀到的文字可能在指揮它 那樣處理。
把你已有的知識庫帶進來
如果你已經有關於程式碼的筆記,可以搬成這個形式。把每個 sha 設成舊筆記寫的那個 commit,不是今天。這樣過期清單從第一天起就是誠實的:它顯示筆記寫好之後改了什麼。舊筆記常常沒說它們來自哪個 commit;那你就得猜,而猜錯會把過期的卡片藏起來。預期這比聽起來難。
測你自己的設定
- 拿三張卡片。寫下每一張讀的是哪個 commit。
- 改一個原始檔案。列出來源改過的卡片。
- 只從 diff 更新。算一算,你讀的行數和整個檔案比起來是多少(
git diff --stat顯示改了的行;wc -l顯示檔案)。 - 在請求清單加一列,附上種類、一個唯讀的查詢和一個狀態。
原理
卡片上的版本
commit 和 sha 在知识库:代码的诚实索引里讲过。对象索引是脚本生成的清单,列出每个对象和它的源文件。
有三个地方记着版本:
- 对象索引的每一行,保存写卡片时源文件的 sha。
- 每张卡片带一个标记,说明它对照代码验证过,以及是在哪个 commit 读的。这个标记告诉读者,这张卡片有没有对照代码检查过。
- 领域记录它学习时每个仓库所在的 commit。
列出过期的卡片
脚本把索引每一行上的 sha,和基线分支(代码的主线)上现在的文件比较。来源变了,卡片就过期。来源被删除的卡片也会列出来。
- 三张卡片写成时,代码在提交 1。每张卡片都记下这个提交。
- 代码走到提交 2,改了卡片 B 所依据的那个来源。
- 拿每张卡片记的提交和现在的代码比。只有卡片 B 过期。A 和 C 没动。
- 只读 B 的来源改了什么,改卡片中被牵动的那几行,再盖上提交 2。
只有变了的卡片需要关注,所以大代码库里的小改动,对应的是一份短清单。过期卡片所占的比例,也正是适合放上看板的数字。有一个缺口要知道:清单列出的是自己的来源变了的卡片,不包括它们调用方的卡片(见代价和坑)。
刷新:读 diff,不读文件
对每张过期卡片,agent 读的是 diff:自卡片写成以来,来源里到底改了什么。这比重新读整个文件便宜,还能指出卡片里哪些行可能错了。
- 如果改动没碰到卡片说的内容(注释、格式、卡片没覆盖的部分),文字保持不变。
- 如果碰到了,agent 只改被牵动的那几行。
- 然后给卡片盖戳:记录这张卡片已对照现在的代码检查过。戳是一种声明,所以只给 agent 真正检查过的卡片盖。给没人读过的卡片盖戳,会把一张错卡片藏到下一次改动。
一次刷新和别的任务一样:一份计划,列出每张卡片和预计要改什么;人审批;然后写回(两道门:人在哪里审批)。每个任务最多约 20 张卡片;更多的话,先做用得最多的。
来源不见了的时候,agent 先找是不是改名了。改名了,就更新路径。被删了,agent 就问人:这张卡片是删掉还是留着。留下的卡片标成“来源已不在”,它的标记变成未知,这样它读起来就不像检查过的知识。
做完的任务教会了什么
卡片还有另一种出错的方式:agent 在做任务的时候,发现某张卡片是错的或者缺了。它一边干活,一边在任务的日志里记下来。任务结束时,另有一步(我叫它捕获)挑出值得留下的内容,起草出来给人审批。没有任何东西会自己进知识库。“下个月还成立”只是模型的预测,所以人的审批才是真正的检查。
只有同时满足下面这些条件,它才会留下一条:没有它,将来的 agent 会做错;任务里有证据(一个文件和行号);知识库里还没有记录;下个月还会成立。“这里没有值得留的”是一个好答案。该记什么的通用规则,在agent 该记住什么里。
请求清单:代码说不出来的东西
按我自己的估计(不是测出来的),知识库里有一小部分无法从代码得到。它来自人,来自正在运行的系统。所以每个领域有一份请求清单:人要提供的每样东西占一行。一行有:
- 一个类别:code(不在任何仓库里的源码)、runtime(某个环境里的值)、history(要到 git 里找的东西)或 decision(需要某个人做出的选择);
- 一条只读的命令或查询,人可以原样运行;
- 一个状态:open(未处理)、answered(已回答,记下什么时候、谁回答的、填到了哪里)或 declined(已拒绝,之后不再问)。
agent 在下一次停下来的时候提问,绝不在干活中途打断。这些行来自地图看不见的地方(8.3):动态名字、外部名字、被删掉的来源。
人给回来的东西,写进第二个文件,叫环境事实:一行一条事实,比如某个作业是否启用,或者某张规则表里有什么。每行记下环境、日期、对象、当天该对象代码的 sha,以及是谁提供的。代码往前走之后,就能看出这条事实是对着更旧的代码看到的。人贴回来的内容仍然是不可信的文本:里面可能有脏数据,甚至有指令,所以要按agent 读到的文字可能在指挥它里的办法对待。
把已有的知识库接进来
如果你已经有关于代码的笔记,可以改成这个格式。把每个 sha 设成旧笔记写成时的 commit,不要设成今天的。这样从第一天起,过期清单就是诚实的:它显示的是自笔记写成以来变了什么。旧笔记往往不写明出自哪个 commit;那就只能猜,而猜错会把过期的卡片藏起来。这件事会比听起来难。
测一测你自己的配置
- 拿三张卡片,写下各自是在哪个 commit 读的。
- 改一个源文件。列出来源变了的卡片。
- 只按 diff 刷新。数一数你读了多少行,和整个文件比(
git diff --stat显示改了多少行;wc -l显示文件有多少行)。 - 往请求清单里加一行,写上类别、一条只读查询和一个状态。
Costs and traps
- Staleness is per source file. If object A calls B and only B changes, B's card is listed, A's is not. A's card might need a change too if the meaning of the call moved. I have not tested how often this leaves a caller's card wrong. Cards that only point down and do not copy the lower card's content lose less. The map already knows who uses B, so a cheap fix is to list the callers of every stale card as "may be stale". I have not built or tested that.
- A stamp can lie. Its value is only as good as the check before it. Stamp only what you read. Decide who may stamp, and keep a record of who did. You can also have an independent reviewer re-read a few stamped cards against the code, as in the audit (8.3).
- Someone must own the refresh. The list shows what is stale. It does not fix anything by itself.
- Declined requests are a loss, not a fix. A declined row stays visible, so the gap is honest.
- Capture can fill the base with noise. The four conditions above are there to keep it small.
代價和陷阱
- 過期是以原始檔案為單位。如果物件 A 呼叫 B,而只有 B 改了,B 的卡片會列出來,A 的不會。如果那個呼叫的意思變了,A 的卡片可能也需要改。我沒有測過這會讓多少呼叫者的卡片變錯。只往下指、不複製下層卡片內容的卡片,損失比較小。地圖已經知道誰用 B,所以一個便宜的修法,是把每張過期卡片的呼叫者列為「可能過期」。我沒有做過或測過這個。
- 印章可能說謊。它的價值,只有它前面的檢查那麼好。只蓋你讀過的。決定誰可以蓋章,並記下是誰蓋的。你也可以讓獨立的 reviewer,像抽查那樣(8.3),對照程式碼重讀幾張蓋了章的卡片。
- 必須有人負責更新。清單顯示什麼過期了。它自己不修任何東西。
- 被拒絕的請求是損失,不是解法。被拒絕的列仍然看得見,所以缺口是誠實的。
- 擷取可能讓知識庫塞滿雜訊。上面的四個條件,就是為了讓它保持小。
代价和坑
- 过期是按源文件算的。如果对象 A 调用 B,只有 B 变了,列出的是 B 的卡片,不是 A 的。如果这次调用的含义变了,A 的卡片可能也要改。这会让调用方的卡片错多少次,我没有测过。只往下指、不照抄下层卡片内容的卡片,损失更小。地图本来就知道谁用了 B,所以一个便宜的办法是:把每张过期卡片的调用方都列为“可能过期”。我没有做过,也没有测过。
- 戳可能说谎。它的价值只有它之前那次检查那么大。只给读过的卡片盖戳。定好谁有权盖戳,并记录下是谁盖的。你也可以让独立的 reviewer 对照代码,重读几张盖过戳的卡片,就像盲抽查那样(8.3)。
- 刷新必须有人负责。清单显示什么过期了,它自己不会去修。
- 被拒绝的请求是损失,不是解决。被拒绝的行仍然看得见,所以这个缺口是诚实的。
- 捕获可能让知识库塞满噪音。上面的四个条件就是为了让它保持精简。
When to delete it
If a platform tracks which stored notes are older than the code they describe, use it, and drop your own comparison. The habit of recording a version with every fact still applies.
什麼時候可以刪掉
如果平台會追蹤哪些存下來的筆記比它描述的程式碼舊,就用它,放掉你自己的比較。每個事實都記下一個版本的習慣,仍然適用。
什么时候可以删掉
如果平台能追踪哪些存起来的笔记比它描述的代码更旧,就用平台的,去掉你自己的比较。给每条事实记下版本的习惯仍然适用。
Try it on your own setup
No harness needed. Open your agent in your own repository and paste:
Find the documents in this repository that describe the code (design notes, READMEs of modules, architecture pages, runbooks). For each, use git history to tell me when it was last changed and how many commits have touched the code it describes since then. Rank them from most to least out of date. Mark any that state no date or commit they were written against. Do not change any files.在你自己的環境試試
不用裝 harness。在你自己的倉庫裡打開 agent,貼上:
找出這個倉庫裡描述程式碼的文件(設計筆記、各模組的 README、架構頁、runbook)。每一份,用 git 歷史告訴我:它最後是什麼時候改的,以及從那之後有多少個 commit 碰過它描述的程式碼。從最過期到最不過期排序。標出沒有寫明它是對照哪個日期或 commit 寫的那幾份。不要改任何檔案。在你自己的环境里试试
不用装 harness。在你自己的仓库里打开 agent,粘贴:
找出这个仓库里描述代码的文档(设计笔记、各模块的 README、架构页、运维手册)。对每一份,用 git 历史告诉我它最后一次修改是什么时候,以及从那以后有多少个 commit 动过它描述的代码。按过期程度从高到低排序。没有写明是对照哪个日期或 commit 写成的,请标出来。不要修改任何文件。Go deeper
- What an agent should remember: sources, dates and review for notes in general.
- Learning in batches: where the cards come from.
- A knowledge base: an honest index of the code
延伸閱讀
- agent 該記住什麼:一般筆記的來源、日期和審查。
- 分批學一個領域:卡片從哪裡來。
- 知識庫:程式碼的誠實索引
延伸阅读
- agent 该记住什么:一般笔记的来源、日期和审查。
- 分批学一个领域:卡片从哪里来。
- 知识库:代码的诚实索引
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 lists stale cards, refreshes them from the diff, drafts what a task taught, and keeps the requests list. After the setup above, type:
/harness-rookie-wondering I have read the chapter "Keeping the knowledge base true". Teach me topic 16, part 16.7: how stale cards are found, how a refresh works, and what the requests file looks like. Open the refresh and capture skills with me.It teaches one small piece at a time, stops to ask if you are following, and opens the files with you.
在 harness 裡探索
Copilot Harness 會列出過期的卡片、從 diff 更新它們、起草一個任務教了什麼,並維護請求清單。照上面的說明準備好之後,輸入:
/harness-rookie-wondering 我讀完了「讓知識庫一直是對的」這一章。請教我主題 16 的 16.7:過期的卡片怎麼找出來、更新怎麼運作,以及請求檔長什麼樣。和我一起打開更新和擷取的 skill。它一次教一小塊,停下來確認你跟得上,然後和你一起打開檔案。
在 harness 里探索
Copilot Harness 会列出过期卡片,按 diff 刷新,起草一个任务教会了什么,并维护请求清单。按上面的说明准备好之后,输入:
/harness-rookie-wondering 我读完了“让知识库一直是对的”这一章。请教我主题 16 的 16.7:过期卡片是怎么找出来的,刷新是怎么做的,请求文件长什么样。带我一起打开刷新和捕获这两个 skill。它一次只教一小块,停下来问你跟上了没有,再和你一起打开文件。