返回课程总览 · 上一章 · 下一章

IndyDevDan · 51:36 · 发布 2026-02-23 · 22.8万次观看(截至抓取) · 观看原视频 🔥 观众最高回放 29:56 — 本片高回放时刻见对应章节

主旨

写一个 ext:钩子拦截 ls 命令必须先建任务清单才能跑,清单未完不被允许,把”任务必须跑完”做成 Pi 工具层的硬约束演示控制 harness 能弥补很多模型失误——作者把模型降级到 Haiku 仍能跑完 16 个文件任务

核心论点

  1. Tilldone = “till done”,不是 to-do——agent 必须把任务清单跑完才能继续,这种”未完不许走”是 harness 层面的硬约束。(→ 详解1)
  2. 钩子拦 ls 必须先建任务清单——这是把”先有清单才能干活”做进扩展:用 onToolCall 钩子,在 ls 工具调用前判断任务清单是否为空,空就拒。(→ 详解2)
  3. 作者把模型换成 Haiku 仍能跑完——这是本片的关键工程证据:控制 harness 能弥补很多模型失误。v8 的本质是 harness engineering 的具体化 demo。(→ 详解3)
  4. 每一项 done 才能前进,human 在节点审批(清空 list 时问用户)——这是 Ralph Loop 的 harness 化实现。(→ 详解4)

知识点详解

1. Tilldone 的命名与边界 20:11

Not to do, not to done. This is till done. So let me show you what this thing can do. I’ll just type ls. And you’ll notice something really interesting here right away. So ls wants me to ls. You can’t do an ls. So so I blocked ls from running. (20:11)

明确告诉观众名称:不是 to-do list,till-done——“till done”是与 Ralph Loop 同方向的硬约束机制。

2. onToolCall 拦 ls 必须先建任务清单 20:35

My agent must add a to-do item in the list before it runs ls. So check this out. It’s going to finish up here and let’s scroll back up. We have a till done list, not a to-do list. This is a till done. My agent must work until this work is done. (20:35)

钩子的语义是:任务清单非空 + 当前 ls 在列表中 + 该任务还没标记 done 才能调。其他一律拒。这是把”任务即会话”做进 harness:agent 跑工具的成本不再是”模型输出”,而是”清单里的当前 in-progress 项”。

3. 把模型降级到 Haiku 仍能跑完 16 个 TS 文件任务 21:46

I want to show you that controlling the harness can make up for a lot of model mistakes, right? Even the top tier models. But let’s go and dumb this model down. (21:46)

Right now we’re running Sonic 4.6. I’m going to go ahead and look for that haiku. An okay model, but we’re definitely talking about bottom tier intelligence. All right, that bottom third. (21:50)

作者把模型换到 Haiku(被列为”底端”模型),然后让 agent:

  1. 创建 tree.mmd 文件(代码库结构树)
  2. 对每个 TypeScript 文件读一遍 + 一句话摘要写进 tree.md
  3. 每完成一项即标记 done

Haiku 跑 16 项完成后全部正确——这是一个强证据:harness 约束比模型上限更影响产出。这呼应了 AI 编码光谱 中 vibe coder 与 agentic engineer 的分界:后者靠 harness 工程保证质量,不靠模型智慧。

So you know any agent that wants to clear the list has to run it by the engineer. All right. So this is a great tool for inloop agentic coding. So I’m just going to go ahead and said yes. (23:32)

清单清空时还要问 user——这是把 Human-in-the-Loop审批 做在扩展里。

4. 与 Ralph Loop 的对照 20:51

If you’re starting to think about Ralph Wiggum or you’re starting to think about agentic loops and you’re starting to think about adding determinism to your agents via hooks or full-on code that wraps your agents, you’re on the right track. (20:51)

作者亲自点出与 Ralph Loop 的关联——Ralph 是 Anthropic 提的”PRD/任务清单给 agent 推进,每步验证通过才前进”的循环;v8 是同一概念在 Pi 内的具体 ext 实现。

可执行步骤

  • 写 till-done ext: 注册一个 in-memory “TaskList” 模块,工具调用前用 onToolCall 钩子检查
  • list tools 拿到 Pi 的工具列表,在 hook 里对每个工具强制要求 TaskList 至少一项 in-progress
  • 跑一条 prompt 让 agent 创建 tree.md + 16 个 TS 文件摘要,观察任务清单逐步推进
  • 用 Haiku 模型跑同样的 prompt,验证 harness 约束确实弥补了模型失误
  • 装上 ext 后清空 TaskList,观察 hook 拦下任何调用直到你 add new task

关联

  • 印证(同一思路):Ralph Loop / forward-goal —— v8 是这两个概念在 Pi harness 上的具体落地
  • 互补:Human-in-the-Loop审批 —— v8 的”清空清单须 engineer 同意”是这个泛概念的 demo 实例
  • 印证(harness 占 90%):Harness / Harness 大师课 —— “控制 harness 能弥补很多模型失误”是大师课的核心证据

一手来源与延伸

  • Pi extension 文档:https://pi.dev/ — lifecycle hook + 持久化 UI 实现细节
  • 配套代码:pi-vs-claude-code 仓库,有完整 tilldone.ts 700 行参考实现

术语

  • Tilldone list:任务清单,每一项必须 in-progress + done 才能前进;与 to-do 不同的是它强调”未完不许走”
  • Inloop agentic coding:在 agent loop 内做 harness 工程,vs outloop 指在 loop 外做产品化封装
  • onToolCall hook:Pi ext 钩子系列,在工具调用前 / 后介入,这里是”前”介入挡驾

金句

If you’re starting to think about Ralph Wiggum or you’re starting to think about agentic loops and you’re starting to think about adding determinism to your agents via hooks or full-on code that wraps your agents, you’re on the right track. (20:51) — 作者点破与 Ralph Loop 与 harness 工程的关系。

立场与利益

  • 利益中性:hook + TaskList 是工程模式,无直接挂商品

价值定位

本片目标学习者的价值:

  • 适合谁:把 agentic loop 当产品工作的工程师——质量必须可重现
  • 解决什么:任务必须有硬约束 + 每步可观察 + 模型上即使换低也能跑通 = harness 工程证据
  • 认知 vs 实操:实操偏重:需要写 ext + hook + TaskList 模块
  • 跨源最强重叠:与 Ralph Loop / forward-goal 是同一概念的同一实现层

自检问题

  1. “Tilldone” 与传统 “to-do list” 的核心区别是什么? 答案:Tilldone 是”未完不许走”的硬约束,必须把清单跑完才能继续;to-do list 只是辅助提示,agent 不一定跑完。回跳 20:11
  2. onToolCall 钩子在 v8 里怎么使用? 答案:在 onToolCall 钩子里检查 TaskList 是否为空、当前任务是否 in-progress——否则拒接 ls 等工具调用。回跳 20:35
  3. 作者把模型降到 Haiku 仍能跑完 16 个 TS 文件任务,这证明了什么? 答案:控制了 harness(任务清单 + 工具约束 + 完成 prompt)后,即便用底端模型也能跑完结构化任务——证明 harness 占能动工程质量的上限。回跳 21:46
  4. v8 与 Ralph Loop / forward-goal 的关系? 答案:Ralph Loop 是把 PRD 推进到完的循环;forward-goal 是设目标 + 成功标准后让 agent 自主推进到终态;tilldone 是这两者在 Pi 内的具体 ext 实现层。回跳 20:51