All Code Is Slop (Except Mine) — Lauren Tan, SpaceXSI
⚡ 速览
SpaceXSI 首席工程师 Lauren Tan 讲解 Grok Bot 团队如何做到单月 11,000 个 PR、revert 率仅 0.5%:把每一次对 agent 的纠错固化成代码里的确定性检查,禁掉需要手感才能用好的 API 和全部注释,再叠上运行时与形式化验证——直到 PR 默认就是好的。
英文原文
SpaceXSI principal engineer Lauren Tan explains how her Grok Bot team ships 11,000 pull requests a month with a 0.5% revert rate — by turning every agent correction into a deterministic check, banning nuanced APIs and comments, and layering runtime plus formal verification until pull requests are good by default.
Toby's Take
一、code is memory,是全场最有价值的一个想法
codebase 里的做法往往会变成 agent 的参考和输入,代码里出现的antipattern和tech debt,在AI时代,其损害性和代价会比以往过去任何时间都高。以前tech debt只是静态的,一段等待修复的内容,现在变成了会被AI参考并且复制扩散的病灶起点。所以维护代码质量、清理 antipattern 应该是最高优先级。
她给的解法也很务实:每次纠正 agent,先问能不能变成一条 lint 规则、一个类型约束,能落代码的就不要往 AGENTS.md 里加散文。
二、结尾的 outer loop 我觉得很妙
每次发版自动拉起一个 agent,像真实用户一样把整个应用跑一遍找 bug,找到就开修复 PR 然后自动合并。我们最近本来打算买一台 Mac mini 循环跑 e2e,但如果是 agent 主动找 bug 显然好得多——e2e 只能防回归,agent 能发现你根本没想到要测的问题。我认为是比e2e更加领先一个时代的做法。理想情况下,e2e还是主打回归和基础功能的守卫,而agent可以提供更加接近实际使用者的具体测试和体验!
三、对"全交给 AI"的终局我不太支持哈哈哈
这属于理工科的 lazy dream 。提高自动化我是喜欢的,但把全自动当成终点没有意义。她一边说"已经没什么可 review",一边说 70% 的 token 烧在验证上,可见信任不是靠自动化比率堆出来的。我最近越来越多参与设计和规划的工作,越发觉得一个产品的好坏,很大程度在早期的产品定位和行为设计上;代码的稳定性也一样,很取决于早期的架构设计。这些判断没有验证产物能替代——自动化提高的是下限。
一开头的用户理解和流程设定才定上限 —— 而这部分,在我看来,因为 input 的限制,是很难被AI直接替代的🤔 而所谓 "taste" 这个东西,太玄学轻叹了,给人一种非常华而不实的感觉。就这么说吧,你taste定格的产品,必然能保证什么商业结果吗?不能哦
🗺 章节地图
💡 核心亮点
人人都能当 coding machine
有了 agents 人人都能当 coding machine——新玩法是在产量暴涨的同时保住质量。
开场全场举手:谁都看过别人代码冒出'全是 slop'的念头。Tan 上个月个人发了 3,000 个 PR 到生产环境,很多是睡着时发的。agents 之前,产出量只属于离群天才——比如 Bret Taylor,一个周末重写整个 Google Maps。她花了六个月才走到这一步,后来者会更快。
EN original
Anyone can now be a coding machine
Opening with a show of hands: everyone has judged someone else's code as slop. Tan shipped 3,000 pull requests to production last month, many 'in her sleep'. Before agents, volume belonged to outliers like Bret Taylor, who famously rewrote all of Google Maps in a weekend. It took her six months to reach this point; newcomers will get there faster.
信任金字塔:确定性层优先于散文层
约束 agent 能做什么,逼它默认做正确的事。
倒金字塔给投入排序:代码库(API 设计、架构)、静态分析(类型、lint、CI)、验证(运行时+形式化)、散文(rules/skills/AGENTS.md)、人工 review——越往下越贵。
最上两层是确定性的,组合起来约束 agent;验证层找 bug 并确认 agent 理解了你的意图;散文层放需要判断力的规则。
EN original
The trust pyramid: deterministic layers before prose
Tan's inverse pyramid ranks where to invest: codebase (API design, architecture), static analysis (types, lint, CI), verification (runtime + formal), prose (rules, skills, AGENTS.md), human review — cheapest at top, most expensive at bottom. The top two layers are deterministic and combined to constrain agents; verification finds bugs and checks the agent understood your intent; prose carries judgment calls.
纠错用确定性检查,别加散文
放进代码里的约束,可复现性才强。
agent 的输出照着输入生成,而代码库是它最大的输入之一。所以每次纠正都应固化成确定性检查——一条 lint 规则、一个类型、一个架构约束——而不是往 rules 或 AGENTS.md 里再加一行。代码里的约束可复现、可信任;散文规则靠 agent 自觉。
EN original
Correct agents with deterministic checks, not more prose
Agents generate outputs from inputs, and the codebase is one of the largest inputs. So every correction should become a deterministic check — a lint rule, a type, an architectural constraint — instead of another line in rules or AGENTS.md. Code-embedded constraints are reproducible and trustworthy; prose rules depend on the agent's judgment.
代码库是花园——杂草会经每个 agent 扩散
在下一个 agent 眼里,杂草就是既定模式,照抄不误。
2024 年她一早上 review 3 个 PR;今天接近 300——每个工程师带着几百上千个 agent 的队伍,代码像连续的流涌进来。任何变通写法、反模式、废弃代码、技术债都会被下一个 agent 当成既定模式照抄。护栏是混凝土地基,新代码绕着它生长;工程师的工作正在变成园艺。
EN original
Your codebase is a garden — weeds spread through every agent
In 2024 Tan reviewed three PRs a morning; today it's closer to 300 — every engineer leads a team of hundreds or thousands of agents, and code arrives like a continuous stream. Any workaround, anti-pattern, deprecated code or tech debt gets copied by the next agent as the established pattern. Guardrails are the concrete foundations new code grows around; gardening is now the job.
禁掉需要手感的 API:useEffect 教训
凡是需要手感才能用好的东西,往往导致 slop。
团队的客户端框架 Dune('Electron 界的 Next.js')把桌面应用的经验编码成约束和 lint 规则。第一条:useEffect 有正当用例但要 PhD 级手感才能用好——产品代码里直接禁用,只允许在 Dune API 内部使用。问题被范畴性消灭,code review 再也不用抓。
EN original
Ban nuanced APIs: the useEffect lesson
Dune, the team's client framework ('Next.js for Electron apps'), encodes desktop-app lessons as constraints and lint rules. Lesson one: useEffect has legitimate uses but demands a PhD to use well, so it's banned in product code and allowed only inside Dune APIs. The problem is categorically eliminated — code review never catches it again.
目录结构即上下文:禁渲染/主进程互相 import
code review 时少一件要盯、要想的事。
在 Cursor(Electron 应用)里,agent 反复把主线程代码 import 进渲染线程,造成 long task 和卡顿。
Grok Bot 和 Dune 应用用两个顶层目录 ElectronRenderer / ElectronMain,相互 import 被依赖图分析器 + lint 规则禁止——配置简单,效果永久。
EN original
Context through directory structure: forbid renderer↔main imports
In Cursor (an Electron app), agents kept importing main-thread code into the renderer thread, causing long tasks and jank. Grok Bot and Dune apps use two top-level directories, ElectronRenderer and ElectronMain, with imports between them forbidden by a dependency-graph analyzer plus lint rules — simple to set up, permanent in effect.
注释是负债:65,824 砍到 1,227
注释最要命的一点:不可强制执行。
agent 把辩护词写进 markdown——注释、文档、rules——为不做正确的事找理由,还会把小纠正过度反应成死规矩。Cursor 里 agent 用命令式定时器给架构冲突(VS Code 命令式 vs React 声明式)打补丁,GC 压力导致卡顿,注释还全是辩护词。
Grok Bot 禁掉 99% 的注释:易过时、没人读、是逃跑舱门。lint 规则给出友好报错,把 agent 指向根因。
EN original
Comments are liabilities: 65,824 down to 1,227
Agents write justifications into markdown — comments, docs, rules — for not doing the right thing, and over-rotate small corrections into unbreakable rules. In Cursor they patched an architecture clash (VS Code imperative vs React declarative) with imperative timers, causing GC pressure and jank, with comments justifying every quick fix. Grok Bot banned 99% of comments: they go stale, nobody reads them, and they're an escape hatch. Lint rules with helpful errors point agents at the root cause.
review 收缩成看验证产物;feature map 给 agent 词汇表
已经没什么可 review 的了——agent 大部分 PR 自己合并。
每次纠错都变成确定性检查之后,review 要盯的东西越来越少,直到 agent 大部分 PR 自己合并。code review 变成看产物:视频、截图、图表、形式化证明。
运行时验证让 agent 自己跑代码(Chrome DevTools 协议);feature map 是用户视角的全功能站点地图,给人和 agent 共享词汇表;skill 内置自定义 CLI 省 token 且可测试。
EN original
Review shrinks to verification artifacts; feature maps give agents vocabulary
Every correction turned into a deterministic check means less to look for in review, until agents merge most of their own PRs. Code review becomes reviewing artifacts: videos, screenshots, diagrams, formal proofs. Runtime verification gives agents the ability to run code (Chrome DevTools protocol); the feature map is a user-view sitemap of all features giving a shared vocabulary; custom CLIs inside skills cut token usage and are testable.
TLA+、Lean、Bombadil:验证的黄金时代
agent 把验证成本砍掉数量级——软件测试与验证的黄金时代到了。
TLA+ 对跨设备通知等重大用户流做模型检查;Lean 证明自研虚拟化库无闪烁抖动;Bombadil 对 UI 做基于属性的测试并已抓到 bug。这些都不是新技术——只是以前难懂难写难维护、贵到用不起。
Cindy 六个月内从'无法信任 agent'走到每天 70% token 烧在验证上;Tan 的 token 花法一致。
EN original
TLA+, Lean, Bombadil: a golden age of verification
TLA+ model-checks major user flows like cross-device notifications; Lean proves properties of their custom virtualization library (no flickering or jittering); Bombadil does property-based UI testing and has already caught bugs. None of this is novel — it was prohibitively expensive to understand, write and maintain. Cindy went from 'can't trust my agents' to 70% of daily tokens on verification in six months; Tan's token spend tracks the same.
单月 11,000 PR、0.5% revert 率——应用反而更快
代码库足够好,PR 默认就是好的。
Grok Bot 团队上个月发了夸张的 11,000 个 PR,大约每天切一个稳定版,顺手型贡献者也多了。revert 率相对下降、稳定在 ~0.5%。性能多维改善——冷启动 −39%、长会话打字中位数 −65%——而且它还是 Electron。
每次发版自动拉起 Cursor project,像真实用户一样 fuzz 全应用,开修复 PR 并自动合并。
EN original
11,000 PRs a month, 0.5% revert rate — and the app got faster
The Grok Bot team shipped a ridiculous 11,000 PRs to production last month, cuts a stable release about once a day, and attracts drive-by contributors. Revert rate dropped on a relative basis to a steady ~0.5%. Performance improved on multiple dimensions — cold launch −39%, long-chat typing median −65% — even though it's still Electron. Each release triggers an automated Cursor project that fuzzes the whole app like a real user, opens fix PRs and auto-merges them.
先地基后工厂:别自动化一个产 slop 的内环
内环产 slop,自动化只会放大 slop。
建软件工厂之前,先用改进代码库的方式纠正 agent:一条 lint 规则防新增反模式、清掉旧模式、再把验证故事做强。这些本来就是自动化的前置条件——自动化产 slop 的内环,只会逼你往问题里砸越来越多的 token。
代码库、静态分析、验证的投资到位后,Grok Bot 的 connectors/routines/projects 作为外环编排几百上千个 agent。
EN original
Foundations before factories: don't automate a slop inner loop
Before building a software factory, correct agents by improving the codebase first: a lint rule to prevent new anti-patterns, clean up the old ones, then make the verification story strong. This work is a prerequisite to automation anyway — automating a slop-producing loop forces you to throw ever more tokens at the problem. Once codebase, static analysis and verification investments land, Grok Bot's connectors, routines and projects orchestrate hundreds of agents as the outer loop.
🎤 金句
有了 agents,人人都能当 coding machine。
EN original
With agents, anyone can now be a coding machine.
每次纠正 agent 时,想想怎么把它变成一个确定性检查,而不是往 rules 或 AGENTS.md 里再加一行——因为放进代码里可复现性强得多。
EN original
Whenever you're correcting your agent, think about how you can make that a deterministic check instead of adding another line to your rules or your agents.md, because it's far more reproducible when it's in code.
凡是需要手感才能用好的东西,往往导致 slop。
EN original
Anything that requires nuance to use well often leads to slop.
注释最要命的一点,是它们不可强制执行。
EN original
The worst part about comments, though, is that they're not enforceable.
到了某个时刻你会意识到:已经没什么可 review 的了,agent 大部分 PR 可以让它们自己合并。
EN original
At some point you realize there's nothing left to review, and you can just let agents merge most of their own pull requests.
agent 把这个成本大幅砍掉了。真的,我们正在进入软件测试与验证的黄金时代。
EN original
Agents drastically cut this cost down. And really, we're entering a golden age of software testing and verification.
如果你的内环编码流程产出的是 slop,那把流程自动化只会产出更多 slop。
EN original
If your inner coding loop produces slop, then automating that loop just produces more slop.
我们的代码库足够好,pull request 默认就是好的。
EN original
Our codebase is good enough that pull requests tend to just be good by default.
🧭 行动建议
- 1 把每次对 agent 的纠正固化成确定性检查 03:13
抓到 agent 做错时,优先上 lint 规则、类型约束或架构禁令,而不是往 AGENTS.md 加散文——代码里的规则可复现、可强制。
EN original
When you catch an agent doing something wrong, reach for a lint rule, type constraint or architectural ban instead of adding prose to AGENTS.md — code-embedded rules are reproducible and enforceable.
- 2 禁掉需要手感才能用好的 API 05:27
如果某个 API(如 useEffect)反复因误用出 bug,在产品代码里直接禁用、只留框架内部使用——这类 bug 被范畴性消灭。
EN original
If misuse of an API (like useEffect) keeps creating bugs, ban it in product code and confine it to framework internals — the bug class disappears categorically.
- 3 把注释当负债治理 08:10
注释会过时、没人读,agent 还拿它给快速补丁写辩护词。删掉,换成报错信息友好的可强制 lint 规则,把 agent 指向根因。
EN original
Comments go stale, nobody reads them, and agents use them to justify quick fixes. Delete them and replace with enforceable lint rules that give helpful error messages pointing at the root cause.
- 4 给运行时验证建 feature map 10:00
给 agent 一份用户视角的全功能站点地图,并在验证 skill 里内置自定义 CLI——共享词汇表、省 token、驱动可测试。
EN original
Give agents a user-view sitemap of all features plus custom CLIs inside verification skills — shared vocabulary, lower token usage, testable drivers.
- 5 把大头 token 预算给验证 12:10
如果每天大部分 token 花在生成而不是验证,隐蔽 bug 就会被合并。验证占 70% 是健康信号,不是浪费。
EN original
If most of your daily tokens go to generation instead of verification, subtle bugs will merge. 70% on verification is a healthy signal, not waste.
- 6 先修内环再上自动化 15:37
软件工厂会放大内环产出的一切。先清代码库、上静态分析和验证——在 slop 上自动化只会收获更多 slop 和爆炸的 token 账单。
EN original
A software factory amplifies whatever the inner loop produces. Clean the codebase, add static analysis and verification first — automation on top of slop just yields more slop and an exploding token bill.
📖 全文
01 · 0:00 · Turning slop into gold
0:00All right. So, again, my name is Potato. I work on Grokbot at SpaceX SI. Can I ask you a quick show of hands? How many of you have ever looked at code that somebody else wrote and you thought, that's all slop? Well, I have two. But today I'm going to convince you that you can turn that slop into gold. And so, I did something crazy last month, and I shipped 3,000 Pluicrests to production. Now, before Agents, we never really cared about volume, except for the outliers. And at my previous company, we called these people coding machines. People like Brett Taylor, who famously rewrote all of Google Maps in a weekend. Just an insanely productive engineer. And while with Agents, anyone can now be a coding machine. And my thesis is that the job of the software engineer, the meta of being a software engineer, is figuring out how to maintain or even improve the quality of your code while massively increasing your productivity. To get there, some people like to call this a software factory.
1:26But I like to keep it simple, and I think of it as all about trust. Not blind trust, but investing in your agent's environment so you can trust that your agents are going to do the right thing. Now, it takes quite a lot of effort to get there, and it took me six months to get to a point where I could ship thousands of Pluicrests, a lot of them, in my sleep. But it's certainly possible, and it will take you much less time than I did. So, let's get to it. So, let's start by talking about how we move from a low-trust environment to a high-trust one. So, this inverse pyramid is how I think about where to spend time on your agent's
02 · 2:03 · The trust pyramid and codebase quality
2:07environment. The first two layers are deterministic. So, using your code itself. So, things like good API design, architecture, refactoring, or using LIT rules, type systems, compilers or, you know, different kinds of testing. And you can use both of these layers in a different way. So, what we're going to do is we're going to use both of these layers together to constrain what agents can do and force them to do the right thing by default. Verification, both runtime and formal, are great tools to layer on to find bugs and check properties and the invariants in your system that you want to hold true, and also help you check whether or not the agent understood your goals and your intent. And then, finally, you want to layer with a little bit of pros. So, things like rules, skills, agents.md, things that require judgment. But let's start with your code base. Agents generate their outputs based on their inputs. And so, the quality of the input really matters. And it just so happens that your code base is one of the largest inputs. So, whenever you're correcting your agent, think about how you can make that a deterministic check instead of adding another line to your rules or your agents.md because it's far more reproducible when it's in code. And it lets you trust it. So, I'm going to show you how to do that.
3:24But you trust it more. And the analogy that I like to use is that your code base is kind of like a garden. You know, code used to arrive a few pull requests at a time. And I remember going into work in 2024 and reviewing the three pull requests that my colleagues wrote. And today, that number is more like 300. So, every engineer is now a team of hundreds or even thousands of agents. And code is arriving. It's arriving so rapidly that it almost feels like a continuous stream. And it almost feels organic like a living thing. And in this analogy, your code base, the constraints that you impose, the guardrails that you put up are the concrete foundations that the new code that your agents write grow around, just like the building in this picture. And so, in many ways, the job of being a software engineer is kind of becoming like gardening. Because code is the biggest input for agents, it means that any work rounds, anti-patterns, deprecated code, tech depth, it's now likely to be just copied by the next agent since it looks like the established pattern in your code base. And it's like you have some weeds or pests growing in your garden. And then they spread everywhere before you know it.
4:49So, you want to make your code base as pristine as possible. So, you want to make your code base as pristine as possible. So, you want to make your code base as pristine as possible so that agents are always copying the good stuff. All right. Let's look at some real examples.
03 · 5:00 · Dune and enforceable architecture
5:00So, Dune is a client framework that we created for Grofbot to implement this idea for organic architecture. It's not really that interesting technically. You can kind of think of Dune as kind of like Next.js for electron apps. But the interesting part of Dune is that it has a lot of constraints and lit rules that we've encoded into a lot of the lessons that we've learned building desktop applications. And one such lesson is that anything that requires nuance to use well often leads to slob. You know, your classic example is, you know, useEffect in React. Right? It has its use cases, but it's often misused. You know, some people joke that you need a PhD to use useEffect. And in other words, it really requires a lot of nuance to use well. And some people are not good at using it. So, our solution has been to just ban it in product code. And it's really only allowed in some places inside of Dune APIs.
6:02And effectively, this problem has now been categorically eliminated. And we never need to catch that during code review again. Another interesting pattern that we use is context through directory structure. So, one anti-pattern that we saw with Cursor, which is an electron app, is that agents would often import main thread code into the renderer thread, which would cause long tasks and jank. So, in GrotBot and in Dune apps, we've made this very, very conventional. We have these two top-level directories, literally called ElectronRenderer and ElectronMain. And imports between them are forbidden or banned by our dependency graph analyzer and some lint rules. And again, you know, these are simple lint rules to set up. It means one less thing that we need to review and think about, you know, during code review.
04 · 6:56 · Replacing comments with lint rules
6:57And then, one more surprising thing that I've seen is agents using markdown. So, things like documentation, code comments, rules for skills. And they use this as a place to write down their justifications for not doing the right thing. Or, I don't know if you've ever seen this, but they'll over-rotate on some small correction that you made. And they treat it like a hard rule that can't be corrected. Like a hard rule that can never be broken ever again. And here's another example from Cursor. So, agents really loved using imperative timers. So, things like setTimeout, requestAnimationFrame, requestIdleCallback. And they were using these as quick fixes. Because they were really patching over an architecture clash between VS Code's imperative style and React's declarative style. So, our choice of architecture actually made both the clashes between VSCode's imperative style and React's declarative style.
7:46So, our choice of architecture actually made both the clashes between VSCode's imperative style and React's declarative style. the client and the agent performance much worse. And if you've ever done any performance work in JavaScript you'll know that when you have tons of timers being rapidly created and destroyed causes a lot of major garbage collection which causes a lot of lag and jank. But the worst part is that agents wrote a lot of code comments like you can see in red here explaining why this quick fix was justified. And before you know it we had timers spreading everywhere and the you know the performance of the app really suffered. Now in Grokbot we learned our lesson there and we decided to just ban 99% of comments because they go stale easily you know humans just really don't bother reading the comment slop anyway. And again it gives an agent the an escape hatch to justify not doing the right thing because it's hard. And the worst part about comments though is that they're not enforceable.
8:45So what seems well-intentioned you know like I'm gonna tell the next agent not to do something never ends up actually being anything that you can trust. So in Grokbot and in Dune we now have lint rules that give good and very helpful error messages telling the agent to fix the root cause, the real problem, rather than just patch around it. And so our general principle is that every time we correct our agents it turns into one of these deterministic checks or we think about how to categorically eliminate that problem in the code through better API design, through better architecture, and if you do this enough times you'll find that you have just less things to look out for in code review. And at some point you realize there's there's nothing left to review and you can just let agents merge their most of their own pull requests. All right moving on. Very
05 · 9:40 · Runtime verification and feature maps
9:42important. Verification is also a really big part of how we make our agents more autonomous and also increase our confidence and trust in their work. And our code review process has now really shrunk into looking at verification artifacts instead. So things like videos, screenshots, diagrams, formal verification, and the most basic example of this is runtime verification, which is just a fancy way of saying giving your agent a way to run the code for itself and use tools that you know human developers use as well, like the Chrome DevTools protocol. In our runtime verification skills we have this thing that we call a feature map. And that's basically kind of like a site map of all of the features that are available in your application from the user's point of view. And so with this agents don't need to guess when you say you know the thingy in the left sidebar. It gives you some shared vocabulary. And we also make use of custom CLIs inside these skills so that agents can reuse the CLI and the driver every time, which cuts down on token usage and is also testable. And then recently we've also started looking at formal
06 · 10:50 · Formal verification and UI testing
10:53verification. So we now use TLA+ to do some model checking of major user flows, such as notifications across multiple devices and platforms. We use a lean as well for proving certain algorithms. For example, we have our own -- we wrote our own custom virtualization library and we use lean there to check that we don't have you know flickering or jittering problems. And we're still experimenting with this approach overall. It seems very promising. We've already found quite a few bugs with formal verification. But it's certainly not a silver bullet and we're treating it as another tool, another layer in our agents environment. And then this is a very fast video, but another thing that we just started looking at is property-based testing as well for UIs. So we use this library called Bombadil. And this has also caught a few UI bugs for us already. Okay. So zooming out, I saw this tweet from Cindy. And six months ago, she said that she
07 · 11:51 · Spending tokens on verification
11:57was -- she was talking about not being able to trust her agents because of subtle bugs that were getting merged. And really what was missing for her in being able to trust her agents was the verification. And that's what we're going to talk about today. We're going to talk about the verification process. And now six months later, she says that 70% of her daily tokens go into verification. And I'd say that that tracks with what I see as well, that most of my token usage goes to verification. And if you really look closely at her process, none of these things here are new or novel techniques that we've never had before. These are just good software engineering tools. But ones that might have been prohibitively expensive to use before as they were hard to understand, or write, or maintain. But agents drastically cut this cost down. And really, we're entering a golden age of software testing and verification. Because agents let us test everything to a much greater degree than used to be economical. And then formal verification can also help you better reason about how your product should work and whether your agents really understand your intent and goals. I made this new skill called state chart in my plug-in P stack, potato stack, which helps you visualize state machines from the user's point of view. And I find this much easier to review alongside the videos and screenshots that we provide. And so that's been great.
13:20Sorry for the flashbang. Okay, now let's look at what the promised land looks like. What do you get in return for all of this investment? So, on the GrofBot team, our velocity is taking off and
08 · 13:32 · 11,000 PRs and a 0.5% revert rate
13:36rapidly increasing. And last month, we were able to get all of this data back into the software. And last month, our team shipped a ridiculous 11,000 pull requests to production. Which is a wild number. And our pace of releasing the client has also increased. And we cut a new stable version about once a day. And then the core team is also shipping much more. And we also have a lot more casual or drive-by contributors who don't always have a lot of context. But they're also contributing. So, despite this velocity accelerating, you might be thinking to yourself, like, isn't this going to be chaos? You know, isn't this going to be a bunch of slop? But actually, the number of PRs that get reverted has actually gotten lower on a relative basis. And it's steady at about half a percent. But I think the really interesting thing about this shipping pace and this volume of pull requests is that the performance of the P stack is very, very low. And it's very, very low. And it's very, very fast. And the performance of Grokbot has stayed not just stable, but has improved on multiple dimensions compared to when we launched. So, startup, typing, opening new chats, switching chats, all of this has gotten faster. And keep in mind, Grokbot is still an Electron app for now. So, there is a ceiling, right? But it's already much faster than many other agent UIs out there. And for an Electron app with this high velocity and this many people contributing, I'd say that's pretty good. So, before you jump into building out a software factory and,
09 · 15:11 · Foundations before software factories
15:14you know, automating everything that you can, whenever you correct your agent, try and do it by improving your code base first. You know, start with a lint roll to prevent new occurrences of anti-patterns. And then clean up those old patterns as well. And then make sure that your verification story is really strong. A lot of this work is a prerequisite to automation anyway. And if your inner coding loop produces slop, then automating that loop just produces more slop. And you need to throw more and more and more tokens at the problem, which we all know is very expensive. And once you meet these investments into, you know, code into your code base, static analysis, runtime informal verification, you'll start to find that many things become possible with these foundations. And that you can really easily build your own factory on top of these foundations. And when you're ready, GrotBot is a great way to build that outer loop. We have tons of connectors, routines that can kick off cursor, cloud agents, and projects which let you orchestrate thousands of hundreds or even thousands of agents. And as a quick example, you know, whenever we cut a new release now, GrotBot will automatically spin up a new cursor project for us that will fuzz the entire application, the entire build, and it will find bugs by running the app and using it like a real user. And then it's going to open up fixed PRs for each of those bugs that it finds and it's going to auto-merge it, as crazy as that sounds. And that's because our code base is good enough that pull requests tend to just be good by
16:48default. And most product code that we land no longer really requires deep human review. So, when you have solid foundations and good organic architecture, you can turn slop into gold. And you can ship with high quality -- high velocity without compromising on quality. My name is Potato, also known as Lauren. Thanks to you again for listening to my talk.
01 · 0:00 · Turning slop into gold
0:00好,自我介绍一下,我叫 poteto,在 SpaceXSI 做 Grok Bot。能快速举个手吗?在座有多少人看过别人写的代码心里冒出过"这全是 slop"的念头?我就有过。今天我要说服大家:你们可以把这些 slop 点成金子。上个月我干了件疯狂的事,往生产环境发了 3,000 个 pull request。在 agents 出现之前,我们其实从不在意产出量,除了那些离群的天才。在我上一家公司,我们管这些人叫coding machine。比如 Bret Taylor,他有名的事迹是一个周末重写了整个Google Maps。产出高得离谱的工程师。而有了 agents,如今人人都能当coding machine。我的论点是:软件工程师这份工作、这个行当的玩法,就是想明白如何在产量暴涨的同时,保持甚至提升代码质量。为了达到这一点,有些人喜欢把这叫做"软件工厂"。
1:26但我喜欢简单点,我认为这全关乎信任。不是盲目的信任,而是投资 agent 所处的环境,让你能相信你的 agent 会做正确的事。这需要下不少功夫。我花了六个月才达到能发几千个 pull request、而且其中很多是睡着觉就发出去的状态。但这绝对做得到,而且你们花的时间会比我少得多。那我们开始吧。先讲讲怎么从低信任环境走到高信任环境。这个倒金字塔就是我对"该把时间花在 agent 环境哪一层"的思考。
02 · 2:03 · The trust pyramid and codebase quality
2:07最上面两层是确定性的,用的是你代码本身。比如好的 API 设计、架构、重构,或者 lint 规则、类型系统、编译器,还有各种测试。而这两层可以换个用法:换个用法。所以,我们要做的是把这两层组合起来,约束 agent 能做什么,逼它们默认做正确的事。验证——运行时和形式化的——是叠上去的好工具,用来找 bug、检查系统里你想保持成立的性质和不变量,还能帮你确认 agent 有没有理解你的目标和意图。最后,再薄薄叠一层散文。比如 rules、skills、AGENTS.md这类需要判断力的东西。但先从代码库说起。agent 的输出是基于输入生成的,所以输入的质量至关重要。而恰好,代码库就是最大的输入之一。所以每当你纠正 agent 的时候,想想怎么把这次纠正做成一个确定性检查,而不是往你的 rules 或 AGENTS.md 里再加一行——因为放进代码里,可复现性强得多。它也更值得你信任。我来展示具体怎么做。
3:24它更值得信任。我爱用的一个类比是:你的代码库有点像一座花园。以前代码是三三两两的 pull request 到达的。我还记得2024 年去上班,review 同事写的三个 pull request。今天,这个数字更接近 300。每个工程师现在都带着一支几百甚至几千个 agent 的队伍。代码正在到来,快得几乎像一条连续的流,几乎有种生命体般的有机感。在这个类比里,你的代码库、你施加的约束、你立起的护栏,就是混凝土地基,agent 写的新代码绕着它生长,就像这张图里的建筑。所以在很多方面,软件工程师的工作正在变得像园艺。代码既然是 agent 最大的输入,就意味着任何变通写法、反模式、废弃代码、技术债,都很可能被下一个 agent 原样照抄,因为在它眼里这就是代码库里的既定模式。就像花园里长出了杂草和害虫,等你察觉时已经蔓延得到处都是。
4:49所以要让你的代码库尽可能纯净。所以要让你的代码库尽可能纯净。要让你的代码库尽可能纯净,好让 agent 复制的永远都是好东西。好,来看几个真实的例子。
03 · 5:00 · Dune and enforceable architecture
5:00Dune 是我们为 Grok Bot 写的客户端框架,用来落地这套"有机架构"的理念。技术上它其实没那么炫。你可以大概把 Dune 理解成 Electron 应用界的 Next.js。Dune 真正有意思的地方是:它内置了大量约束和 lint 规则,把我们做桌面应用积累的许多经验教训编码了进去。其中一条经验是:凡是需要"手感"才能用好的东西,往往导致 slop。经典例子就是 React 里的 useEffect。对吧?它有正当用例,但经常被滥用。有人开玩笑说,用好 useEffect 需要一个博士学位。换句话说,它真的非常依赖手感才能用好。而有些人就是用不好它。所以我们的解法是:在产品代码里直接禁掉。它只被允许在 Dune API 内部的少数地方使用。
6:02于是这类问题被范畴性地消灭了。code review 再也不用抓这类问题了。我们用的另一个有意思的模式是:用目录结构给上下文。我们在 Cursor(它是个 Electron 应用)里观察到一种反模式:agent 经常把主线程代码 import 进渲染线程,导致 long task 和卡顿。在 Grok Bot 和 Dune 应用里,我们把这件事做得非常非常约定化。有两个顶层目录,就叫 ElectronRenderer 和 ElectronMain。它们之间的 import 被依赖图分析器和几条 lint 规则明令禁止。再说一次,这些 lint 规则配起来都很简单。效果是 code review 时少了一件要盯、要想的事。
04 · 6:56 · Replacing comments with lint rules
6:57还有一个让我意外的现象:agent 拿 markdown 当挡箭牌。比如文档、代码注释、rules、skills 这些。它们把这些地方当成"写下不做正确之事的理由"的场所。不知道你们见过没有:你随手做的一个小纠正,agent 会反应过度,把它当成一条不容修正的铁律,一条从此永远不可打破的死规矩。这里还有个 Cursor 的例子。agent 特别爱用命令式定时器。比如 setTimeout、requestAnimationFrame、requestIdleCallback。它们拿这些当快速补丁,因为它们其实在给一种架构冲突打补丁——VS Code 的命令式风格和 React 的声明式风格在打架。于是我们的架构选择实际上让 VS Code 命令式风格与 React 声明式风格的冲突……
7:46于是我们的架构选择实际上让 VS Code 命令式风格与 React 声明式风格的冲突…………同时伤害了客户端和 agent 的性能。只要你在 JavaScript 里做过性能优化就知道:海量定时器快速创建又销毁,会触发大量重度垃圾回收,造成大量卡顿掉帧。最糟的是,agent 写了大堆代码注释——就是屏幕上标红的这些——论证这个快速补丁是何等合理。不知不觉间定时器蔓延得到处都是,应用的性能真的遭了殃。在 Grok Bot 里我们吸取了教训,决定直接禁掉 99% 的注释。因为注释很容易过时,而且人类反正也懒得读注释里的slop。再说,注释给 agent 留了逃跑舱门,让它能为"不做正确的事"找借口——就因为做正确的事很难。而注释最要命的一点是它们不可强制执行。
8:45那些看似善意的"我会告诉下一个 agent 别这么做"——到头来从来不是你能信任的东西。所以在Grok Bot 和 Dune 里,我们的 lint 规则会给出友好且非常有用的报错信息,告诉 agent 去修根因、修真正的问题,而不是绕着打补丁。我们的总原则是:每一次对 agent 的纠正,都变成一条这样的确定性检查;或者想想如何通过更好的API 设计、更好的架构,在代码里把这类问题范畴性消灭。这么做的次数够多之后,你会发现code review 要盯的东西越来越少。到了某个时刻你会意识到:已经没什么可 review 的了,agent 大部分自己的 pull request 可以让它们自己合并。好,继续。非常
05 · 9:40 · Runtime verification and feature maps
9:42重要:验证。它也是让 agent 更自主、让我们对其工作更有信心和信任的一大块。而且我们的 code review 流程如今真的收缩成了看验证产物:视频、截图、图表、形式化验证,最基础的例子是运行时验证——说白了就是给 agent 自己跑代码的能力,让它能用人类开发者也在用的工具,比如 Chrome DevTools协议。我们的运行时验证 skill 里有个东西叫feature map。它基本上就是你应用全部功能的站点地图——从用户的视角出发。有了它,当你说"左边栏那个东西"时,agent 不用再猜。它给了你们一套共享词汇表。我们还在这类 skill 里内置了自定义 CLI,让 agent 每次都复用同一套 CLI 和驱动,既省 token,又可测试。最近我们开始玩形式化
06 · 10:50 · Formal verification and UI testing
10:53验证:用 TLA+ 对重大用户流做模型检查,比如跨多设备、多平台的通知。我们也用 Lean证明某些算法。比如我们自研了一个虚拟化库——我们自己写的——用 Lean 检查它不会出现闪烁或抖动问题。这套方法我们还在实验,但整体前景很好。形式化验证已经帮我们抓到了不少bug。不过它显然不是银弹,我们把它当成又一件工具、agent 环境里的又一层。然后这是一段放得很快的视频,另一个我们刚上手的方向是对 UI 做基于属性的测试。用的库叫 Bombadil,它也已经帮我们抓到了几个 UI bug。好,拉远一点看。我看到 Cindy 的一条推。六个月前她说,
07 · 11:51 · Spending tokens on verification
11:57她没办法信任自己的 agent,因为那些隐蔽的 bug总被合并进来。而她真正缺的、让她没办法信任的东西agent 的,是验证。这就是我们今天要讲的。我们今天要讲的就是验证流程。而六个月后的现在,她说每天烧的 token 有 70% 花在验证上。这和我看到的一致——我的大多数 token 也是花在验证上。仔细看她的流程,里面没有任何史无前例的新奇技术。这些就是优秀的软件工程工具。只不过以前用起来贵得吓人——难理解、难编写、难维护。而 agent 把这个成本大幅砍掉了。真的,我们正在进入软件测试与验证的黄金时代。agent 让我们能把所有东西测到过去不经济的深度。形式化验证还能帮你更好地推理产品应该怎么工作、agent 是否真的理解你的意图和目标。我在自己的插件 pstack(poteto stack)里写了个新 skill 叫 statechart,帮你从用户视角可视化状态机。我发现配合我们提供的视频和截图一起 review,轻松多了。效果很好。
13:20抱歉刚才闪光灯辣眼睛。好,现在看看应许之地长什么样。这些投资能换回什么?在 Grok Bot 团队,我们的速度正在起飞、
08 · 13:32 · 11,000 PRs and a 0.5% revert rate
13:36持续猛涨。上个月,我们把这一整套数据从软件里统计了回来。上个月,团队往生产环境发了夸张的 11,000 个 pull request。这个数字疯狂得很。客户端的发版节奏也提上来了:大约每天切一个新稳定版。核心团队的产出多了很多,还有更多顺手一击型的贡献者——他们未必有很多上下文,但也在贡献。速度这么飙,你心里可能在打鼓:这样不会乱套吗?不会涌出一堆 slop 吗?实际上,被 revert 的 PR比例反而相对更低了,稳定在 0.5% 左右。但我觉得这个出货节奏和 PR 体量下真正有意思的是:pstack 的开销非常非常低……非常非常低,而且非常非常快。Grok Bot 的性能不只保持稳定,还在多个维度上比发布时更好了。启动、打字、打开新会话、切换会话,全都变快了。别忘了,Grok Bot 目前还是个Electron 应用,天花板是在的。但它已经比市面上很多agent UI 快得多。一个 Electron 应用,在这么高的速度、这么多人贡献之下,我觉得相当不错了。所以,在你急着建软件工厂、
09 · 15:11 · Foundations before software factories
15:14把一切能自动化的都自动化之前:每次纠正 agent,先试着从改进代码库入手。先用一条 lint 规则防止反模式再次出现,再把旧模式也清干净,然后确保你的验证故事足够硬。这些工作本来就是自动化的前置条件。如果你的内环编码流程产出的是 slop,那把流程自动化只会产出更多 slop,而且你得往问题上砸越来越多的 token——这有多贵大家都知道。一旦这些投资到位——投进代码库的代码、静态分析、运行时与形式化验证——你会发现很多事情在这些地基之上成为可能,你真的可以很轻松地在上面建自己的工厂。等你准备好了,Grok Bot 是搭外环的好工具。我们有大量 connectors、routines,能拉起 Cursor cloud agents 和 projects,让你编排几百甚至几千个 agent。举个快速例子:现在每当我们切一个新release,Grok Bot 都会自动拉起一个新 Cursor project,对整个应用、整个 build 做 fuzz,像真实用户一样跑应用找 bug,然后为找到的每个 bug 开修复 PR 并自动合并——听起来很疯狂,但这就是因为我们的代码库足够好,pull request 默认就是好的。
16:48我们合入的大部分产品代码,已经不再需要人类的深度 review。当你有了坚实的地基和好的有机架构,你就能把 slop 点成金子,以高速度发布而不牺牲质量。我叫 poteto,也叫 Lauren。再次感谢大家听我的演讲。
SpaceXSI principal engineer Lauren Tan explains how her Grok Bot team ships 11,000 pull requests a month with a 0.5% revert rate — by turning every agent correction into a deterministic check, banning nuanced APIs and comments, and layering runtime plus formal verification until pull requests are good by default.
SpaceXSI 首席工程师 Lauren Tan 讲解 Grok Bot 团队如何做到单月 11,000 个 PR、revert 率仅 0.5%:把每一次对 agent 的纠错固化成代码里的确定性检查,禁掉需要手感才能用好的 API 和全部注释,再叠上运行时与形式化验证——直到 PR 默认就是好的。
Toby's Take
一、code is memory,是全场最有价值的一个想法
codebase 里的做法往往会变成 agent 的参考和输入,代码里出现的antipattern和tech debt,在AI时代,其损害性和代价会比以往过去任何时间都高。以前tech debt只是静态的,一段等待修复的内容,现在变成了会被AI参考并且复制扩散的病灶起点。所以维护代码质量、清理 antipattern 应该是最高优先级。
她给的解法也很务实:每次纠正 agent,先问能不能变成一条 lint 规则、一个类型约束,能落代码的就不要往 AGENTS.md 里加散文。
二、结尾的 outer loop 我觉得很妙
每次发版自动拉起一个 agent,像真实用户一样把整个应用跑一遍找 bug,找到就开修复 PR 然后自动合并。我们最近本来打算买一台 Mac mini 循环跑 e2e,但如果是 agent 主动找 bug 显然好得多——e2e 只能防回归,agent 能发现你根本没想到要测的问题。我认为是比e2e更加领先一个时代的做法。理想情况下,e2e还是主打回归和基础功能的守卫,而agent可以提供更加接近实际使用者的具体测试和体验!
三、对"全交给 AI"的终局我不太支持哈哈哈
这属于理工科的 lazy dream 。提高自动化我是喜欢的,但把全自动当成终点没有意义。她一边说"已经没什么可 review",一边说 70% 的 token 烧在验证上,可见信任不是靠自动化比率堆出来的。我最近越来越多参与设计和规划的工作,越发觉得一个产品的好坏,很大程度在早期的产品定位和行为设计上;代码的稳定性也一样,很取决于早期的架构设计。这些判断没有验证产物能替代——自动化提高的是下限。
一开头的用户理解和流程设定才定上限 —— 而这部分,在我看来,因为 input 的限制,是很难被AI直接替代的🤔 而所谓 "taste" 这个东西,太玄学轻叹了,给人一种非常华而不实的感觉。就这么说吧,你taste定格的产品,必然能保证什么商业结果吗?不能哦