MattPocock | 解决 PR 瓶颈:用 AI 智能体
字幕摘录
| 时间 | 英文 | 中文 |
|---|---|---|
| 0:02 | I'm here to talk about fixing the PR bottleneck, and this is kind of a grand title for trying to | 我是来讨论修补公关瓶颈的 这是种伟大的头衔 试图 |
| 0:10 | fix the thing that most organizations struggle with, I think, and have kind of historically | 我认为,要解决大多数组织斗争的问题,而且有某种历史意义。 |
| 0:14 | struggled with before AI, you know. | 在人工智能之前挣扎过 |
| 0:17 | We have always had huge numbers of PRs just laying around that | 我们总是有大量的公关 仅停留在周围 |
| 0:20 | no one's bothered to review, and this has now increased massively because of the new strains | 没有人会考虑的, 而现在,由于新的压力,这已经大大增加 |
| 0:25 | on us because of AI imposing all these weird constraints. | 因为大赦国际施加了这些奇怪的限制 |
| 0:29 | And to do this, I'm going to use | 为了做到这一点,我要使用 |
| 0:31 | the rubric of My Skills, which you've kind of heard about, maybe you've used them, and I have a | 你听说过的 "我的技巧"的题材 或许你用过了 我有一个 |
| 0:36 | couple of new skills to announce that are going to hopefully improve the way that you do PRs, | 两种新技能宣布 希望能改善你做公关的方式 |
| 0:41 | improve the way that, or improve the speed at which you can review them and do them. | 改进方法,或者提高你审查它们的速度。 |
展开字幕全文(469 条)
| 序号 | 英文 | 中文 |
|---|---|---|
| 1 | I'm here to talk about fixing the PR bottleneck, and this is kind of a grand title for trying to | 我是来讨论修补公关瓶颈的 这是种伟大的头衔 试图 |
| 2 | fix the thing that most organizations struggle with, I think, and have kind of historically | 我认为,要解决大多数组织斗争的问题,而且有某种历史意义。 |
| 3 | struggled with before AI, you know. | 在人工智能之前挣扎过 |
| 4 | We have always had huge numbers of PRs just laying around that | 我们总是有大量的公关 仅停留在周围 |
| 5 | no one's bothered to review, and this has now increased massively because of the new strains | 没有人会考虑的, 而现在,由于新的压力,这已经大大增加 |
| 6 | on us because of AI imposing all these weird constraints. | 因为大赦国际施加了这些奇怪的限制 |
| 7 | And to do this, I'm going to use | 为了做到这一点,我要使用 |
| 8 | the rubric of My Skills, which you've kind of heard about, maybe you've used them, and I have a | 你听说过的 "我的技巧"的题材 或许你用过了 我有一个 |
| 9 | couple of new skills to announce that are going to hopefully improve the way that you do PRs, | 两种新技能宣布 希望能改善你做公关的方式 |
| 10 | improve the way that, or improve the speed at which you can review them and do them. | 改进方法,或者提高你审查它们的速度。 |
| 11 | Speed速. | |
| 12 | Now, we're being pushed to do more with less, essentially, or more PRs, more work, more stuff, | 现在,我们被迫做更多的 用更少,本质上,或更多的公关, 更多的工作,更多的东西, |
| 13 | and this is kind of the central promise of AI, that we're going to be able to use these agents | 这是AI的核心承诺 我们就能使用这些特工 |
| 14 | to scale ourselves up to do more work, and this has resulted in the Software Factory, | 扩大我们自己 做更多的工作, 这导致了软件厂, |
| 15 | probably the biggest buzzword of the day. | 可能是今天最流行的词 |
| 16 | Everyone's talking about Software Factory that I've | 大家都在说我的软件厂 |
| 17 | chatted to, and I think of a Software Factory as primarily something where instead of the human | 聊天,我认为一个软件厂 主要是一些 在那里而不是人类 |
| 18 | initiating all of this work, we're going to pass some of that initiation, some of the initiation | 发起所有这些工作, 我们将通过一些启动, 一些启动 |
| 19 | is going to be done by agents, and I think of there, maybe from there, you have a classifier | 我想也许从那里你有个分类员 |
| 20 | like Jev come in and say, okay, let's turn that into a fix, or turn that into a reproduction, | 像Jev进来说,好吧,让我们把它变成一个固定, 或者把它变成一个复制, |
| 21 | or maybe I ping people straight away, and maybe you have other things, maybe you have planet scale | 或者我马上打人 或许你还有别的事情 |
| 22 | hooked up, so it gives you query reports on the slow queries on your database, maybe that then | 连接,所以它给你查询报告 在您的数据库中的慢查询, 也许那时 |
| 23 | triggers a different thing of your Software Factory. | 触发了你的软件厂的异端。 |
| 24 | All of this is not humans triggering it, | 所有这一切都不是人类触发它, |
| 25 | it's deterministic code triggering it, right, and so these accelerate your Software Factory, | 这是决定性的代码触发它,对, 所以这些加速你的软件厂, |
| 26 | they push more code through it, but then you need breaks, right? | 他们推更多的代码通过它, 但你需要休息,对不对? |
| 27 | If you just have permanent | 如果你只拥有永久 |
| 28 | acceleration pushing stuff through your factory, you're going to end up with a slop cannon, right? | 加速推进的东西通过你的工厂, 你会有一个斜谷炮,对不对? |
| 29 | You're just going to end up with a ton of slop crappy PRs that you're not going to be able to | 你只会有一堆烂公关 你无法做到 |
| 30 | touch or review or even freaking look at, so you need breaks. | 触摸或检讨 甚至吓坏了的看, 所以你需要休息。 |
| 31 | These are mechanisms that slow down, | 这些是减速的机制, |
| 32 | that increase quality, that make sure that your code base doesn't turn into a software | 提高质量,确保你的代码基础不会变成软件 |
| 33 | entropy nightmare, because code is the environment your agent operates in, and if you have bad code | 因为代码是您的代理操作环境 如果你有坏代码 |
| 34 | in your code base, that is going to beget more bad code, and so I'm going to talk about these three | 在你的代码库里,那会得到更多的坏代码, 所以我要谈谈这三个 |
| 35 | breaks in this talk, and talk about how we can use them to counterintuitively go faster. | 说说我们如何用它们来反射 更快地前进 |
| 36 | So, automated checks. | 所以,自动检查。 |
| 37 | These are the deterministic checks in your repo that we've had for | 这些是你们重案组的确定性检查 |
| 38 | thousands of years, or, you know, since the 50s. | 几千年,或者,你知道,50年代以后。 |
| 39 | Deterministic checks where we have linting and | 决定性检查,我们在哪里 内衣和 |
| 40 | tests and type checking and code quality metrics, all of these things going together, and they all | 测试和类型检查 密码质量度量, 所有这些事情一起进行, 他们都 |
| 41 | work the same every time. | 每次都一样 |
| 42 | Layered on top of that, we have automated review, so we have agents who | 此外,我们还有自动审查,所以我们有特工 |
| 43 | look at our code and say, okay, you know, these are for the things that the tests didn't catch, | 看看我们的代码,然后说,好吧,你知道, 这些是为了测试没有赶上的东西, |
| 44 | or this is looking at the structure of the code base in general, and then on top of that, the | 或这是从总体上看代码基础的结构, 然后在其中, |
| 45 | third layer, the final layer is human review, so people looking at the PR, and these three layers | 第三层,最后一层是人类审查, 所以人们看公关, 而这三层 |
| 46 | form this kind of cake that we end up with when we get to human review, and so more speed, of course, | 组成这种蛋糕,当我们到达人类审查, 如此快,当然, |
| 47 | means more PRs, and so the goal here is to make human review faster by leaning on those first | 意味着更多的公关,所以这里的目标是 通过靠着那些先让人类的审查更快 |
| 48 | two phases, and we've got to stop the slop. | 分两个阶段,我们得阻止它。 |
| 49 | That's the first principle here, which is if you raise | 这是第一条原则 如果你提出 |
| 50 | the quality of the code that you're shipping, you're going to end up doing less human review | 你运输的代码的质量, 你最后会做更少的人文审查 |
| 51 | because it's just going to be better work, and so you're going to end up needing to make fewer | 因为它只是会是更好的工作, 所以你最终会需要 减少 |
| 52 | interventions. | 干预。 |
| 53 | Automated checks. | 自动检查。 |
| 54 | Now, automated checks are cheap. | 现在,自动检查是便宜的。 |
| 55 | That's the cool thing about | 这才是最酷的 |
| 56 | them is that they don't cost tokens like automated review does. | 他们不会像自动检阅那样花费代币 |
| 57 | They don't cost human effort. | 他们不花费人类的努力。 |
| 58 | They | 他们 |
| 59 | just cost CPU cycles, so these are, for instance, you know, you run your tests on every code change. | 只是花费了CPU周期, 所以这些,例如,你知道, 你运行你的测试 每一次代码更改。 |
| 60 | Maybe those tests do incur some tokens because, let's say, an agent creates a bug and the tests | 也许这些测试确实会产生一些征兆 因为,比如说,一个代理制造一个错误和测试 |
| 61 | catch it, then you need to spend some tokens to go and fix it, but those are tokens pretty well | 抓住它,然后你需要花费一些符号 去修复它,但这些是标志 相当不错 |
| 62 | spent, in my opinion. | 花了,在我看来。 |
| 63 | So, checks are cheap. | 所以,支票是廉价的。 |
| 64 | That means you can layer on loads and loads and loads | 也就是说,你可以堆积 负载和负载 |
| 65 | of them on your repos, and you're probably not using enough of them or not being creative enough | 你可能用得不够,或者没有创造力 |
| 66 | with your use, but checks can lie. | 使用,但支票可以说谎。 |
| 67 | Does a green CI mean that the code is ready for merge? | 绿色CI是否意味着代码可以合并? |
| 68 | No, it | 不,这是 |
| 69 | does not, and so we've always needed on top of these checks some extra layer to figure out if | 没有,所以我们一直需要 在这些检查之上 一些额外的层以确定是否 |
| 70 | there's anything catastrophically wrong with the code before we ship it, and so all of the other | 在我们发货前 密码有灾难性的毛病 所以其他的 |
| 71 | ways is the human review and automated review, these are lie detectors. | 这些是测谎仪 |
| 72 | These are for finding lies | 这些是用来寻找谎言的 |
| 73 | in the automated checks. | 在自动检查。 |
| 74 | Now, I want to show you some of these lies, first of all, because this | 现在,我想告诉你一些这些谎言, 首先,因为这个 |
| 75 | helps when we're thinking about code and thinking about automated checks to see how bad it is and | 帮助我们思考代码和思考 自动检查,看看它有多糟糕和 |
| 76 | how bad things can get. | 事情会有多糟糕 |
| 77 | The first is tautological tests, a test that just reasserts the implementation. | 第一项是同义测试,这项测试只是重申执行。 |
| 78 | Opus 5 got addicted to these. | Opus 5 迷上了这些。 |
| 79 | I don't quite understand why. | 我不太明白为什么 |
| 80 | It would have, for instance, | 譬如说, |
| 81 | x post character limit equals 280. | x 职位字符限制为 280。 |
| 82 | Can anyone guess the test that was written to test this behaviour? | 有人能猜到 用来测试这种行为的测试吗? |
| 83 | You've probably seen this a thousand times. | 你可能已经看过上千次了 |
| 84 | This is real code from agents or from stuff that I found | 这是特工或我发现的东西的真实密码 |
| 85 | my agents doing. | 我的探员在做 |
| 86 | It said expect x post character limit to be 280. | 它说,预计x职位字符限制为280个。 |
| 87 | So the implementation looked like | 因此,执行看起来像 |
| 88 | that, and the test essentially reasserted the implementation. | 并且考验基本上重申了执行工作。 |
| 89 | That is a tautological test. | 这是一个同义测试。 |
| 90 | And tautological tests are bad because they're extremely structure sensitive. | 而同声测试也因为结构上极其敏感而不好. |
| 91 | They're very | 他们非常 |
| 92 | sensitive to the actual internal workings of the system. | 对系统的实际内部运作十分敏感。 |
| 93 | So it means I cannot change that constant | 也就是说我不能改变这个常数 |
| 94 | without a test failing, but I cannot rename that constant without a test failing. | 测试没有失败, 但我不能重命名该常数 没有测试失败。 |
| 95 | But I have to | 但我必须 |
| 96 | do it so tied into the structure of my system. | 把它绑在我的系统中 |
| 97 | And I found another one which is even more egregious, | 我找到了另一个更惊人的 |
| 98 | I would say. | 我会说。 |
| 99 | This is incredible test. | 这是不可思议的考验。 |
| 100 | What it's doing here is it's essentially testing whether | 它在这里所做的是 它实质上是测试是否 |
| 101 | two things in the UI appear in the right order. | 在UI中,有两件事情以正确的顺序出现. |
| 102 | So it's checking that the pitch detail page or | 所以它正在检查 投球细节页或 |
| 103 | rather the video section comes after the content plan. | 视频部分是在内容计划之后 |
| 104 | What it does is it doesn't render it to a | 它所做的是 它不使它成为一个 |
| 105 | screen. | 屏幕。 |
| 106 | It just reads the actual file, the module, into its own memory, and then it finds the right | 它只是把实际文件,模块, 读到自己的记忆, 然后它找到正确的 |
| 107 | image, and then it expects the videos to be after it in the source material. | 图像,然后它期望视频在源材料中会追随它. |
| 108 | Which is crazy | 这太疯狂了 |
| 109 | if you think about it, because I can just change the way the source material looks and this test | 如果你考虑一下 因为我可以改变源材料的外观和测试 |
| 110 | will fail. | 将失败。 |
| 111 | It's too sensitive to the structure of my code base. | 对我的密码基础结构太敏感了 |
| 112 | So that's another way that automated | 所以这是另一种自动化方式 |
| 113 | checks can fail. | 检查可能失败。 |
| 114 | And there are also, or sorry, automated checks can lie. | 还有,或者抱歉, 自动检查可以说谎。 |
| 115 | There are also tests | 还有测试 |
| 116 | that literally cannot fail. | 这绝对不能失败。 |
| 117 | And this will feel familiar to you if you've abused mocking in the | 这对你来说很熟悉 如果你虐待嘲笑 |
| 118 | use audio boost function. | 使用音频助推功能。 |
| 119 | And this use audio boost function, its internals use the audio context API | 使用音频助推功能,其内部使用音频上下文 API |
| 120 | 在DOM中。 | |
| 121 | Don't worry if you don't know any of this. | 别担心,如果你不知道这些。 |
| 122 | But what we're doing here is we're just | 但我们在这里所做的是 |
| 123 | stubbing it out with some fake methods. | 用一些假方法把它挖出来 |
| 124 | And it turns out the audio context has some complicated | 原来音频上下文有点复杂 |
| 125 | error modes, and it will fail if you use it under strange conditions. | 错误模式,如果在奇异条件下使用,则会失败。 |
| 126 | And so just doing this means | 所以,只要这样做就意味着 |
| 127 | our tests cannot fail using those modes, and we're going to hit strange errors in production | 我们的测试不能失败 使用这些模式, 我们将击中奇怪的错误生产 |
| 128 | that our tests can't fix. | 我们的测试无法修复。 |
| 129 | And so the question is then, if you can cheat on automated checks, | 所以问题是 如果你能通过自动检查作弊 |
| 130 | if, you know, and even in good faith ways as well, the AI isn't trying to write bad tests here. | 如果,你知道,甚至诚信的方式, AI不是试图在这里写不好的测试。 |
| 131 | It's just taking our instructions and writing tests that are too tied into the structure instead | 它只是接受我们的指示 和写作测试 太多绑在结构中 |
| 132 | of actually executing code. | 实际执行代码。 |
| 133 | So how do we make automated checks harder to cheat? | 那么我们如何使自动检查更难欺骗? |
| 134 | If we can do | 如果可以的话 |
| 135 | that, then we can increase the quality of those checks, which means which increases our quality | 这样我们就能提高检查的质量,这意味着提高我们的质量 |
| 136 | bar. | 栏。 |
| 137 | And the first thing I really like about this is code-based design. | 我最喜欢的是密码设计。 |
| 138 | So you can actually | 这样你就可以 |
| 139 | design your way out of these bad checks. | 设计你的出路 这些糟糕的支票。 |
| 140 | So what does good code-based design look like? | 那么,什么是良好的基于代码的设计看起来像什么? |
| 141 | I've talked about this before in previous AI engineering talks I've given, which are deep | 我在之前的人工智能工程演讲中 已经说过了,很深 |
| 142 | modules. | 模块。 |
| 143 | These are modules that hide complex behavior behind simple interfaces. | 这些模块将复杂的行为隐藏在简单的界面之后. |
| 144 | This is a | 这个是 |
| 145 | John Osterhout idea from the philosophy of software design. | 约翰·奥斯特豪特(John Osterhout)从软件设计哲学出发的想法. |
| 146 | If we look at these two modules, | 如果我们看这两个模块, |
| 147 | we've got A, which has a large implementation hiding behind a tiny little interface at the top. | 我们得到了A, 它有一个很大的执行 隐藏在一个小界面后面 在顶端。 |
| 148 | Okay? | 好吗? |
| 149 | And then B is a large interface, lots of functions you can call, and those functions | 然后B是一个大的界面, 你可以调用很多功能, 和这些功能 |
| 150 | individually don't do very much. | 个人做不太多。 |
| 151 | Does that make sense? | 这有道理吗? |
| 152 | Yeah? | 是吗? |
| 153 | Now, if you have a deep module like | 现在,如果你有一个深 模块像 |
| 154 | A here, you're going to have fewer structure-sensitive tests because you're hiding more | 在这里,你会得到更少的结构敏感测试 因为你隐藏更多 |
| 155 | of the implementation behind that interface. | 该接口背后的执行。 |
| 156 | If it's just testing at that interface, you're | 如果只是测试一下界面,你就 |
| 157 | going to get better tests. | 会得到更好的测试。 |
| 158 | So your job here is to force the agent to use that little interface | 所以,你在这里的工作是强迫代理 使用这个小接口 |
| 159 | instead of reaching into the implementation to test these weird implementation details. | 而不是深入执行,测试这些奇怪的执行细节。 |
| 160 | So I've got a skill for this. | 所以我有这个技巧。 |
| 161 | You can have, like, the weirdest vibe-coded code base, the | 你可以有一样, 最怪异的氛围编码 代码基础, |
| 162 | crappiest code base that you've ever set your eyes on, and you can run this skill on it and | 你见过最烂的代码基础, 你可以运行这个技能在它上, |
| 163 | it will make it better. | 它会使它更好。 |
| 164 | What this does is essentially gives you opportunities for deepening | 这基本上让你有机会深化 |
| 165 | modules. | 模块。 |
| 166 | And it kind of looks like this. | 看起来像这样 |
| 167 | Raise your hands if you've used this skill, by the way. | 顺便说一句,如果你用过这种技巧的话,举起手来 |
| 168 | Not sure how many of my folks are in this room. | 不知有多少家人在这间屋子里 |
| 169 | Yeah, okay. | 是啊,没关系。 |
| 170 | It's really freaking nice. | 真他妈的不错 |
| 171 | Essentially, | 其实, |
| 172 | gives you a HTML document, and I'll get out of the way here, of all of the different potential | 给您一个HTML文档, 我会离开这里,所有不同的潜力 |
| 173 | opportunities it sees. | 机会 |
| 174 | So we can see here we have a before and we have an after where we're sort of | 所以,我们可以看到,我们有一个前,我们有一个后 |
| 175 | like reducing duplication. | 像减少重复。 |
| 176 | We're creating a nice deep testable module. | 我们正在制造一个很好的深层测试模块。 |
| 177 | And then you can go ahead | 然后你可以继续 |
| 178 | and implement that. | 并落实这一点。 |
| 179 | And attached to this, there's also this kind of language that I've put together | 并附着于此, 也有这种语言,我已经拼凑在一起 |
| 180 | for describing modules. | 用于描述模块。 |
| 181 | Because, like, if you ever try and read up about how to structure a code base, | 因为,就像,如果你曾经尝试 和阅读如何构建一个代码基础, |
| 182 | you're going to find 20 different approaches and they're all going to be called DDD. | 你会找到20种不同的方法,它们都会被称为DDD. |
| 183 | And, | 还有, |
| 184 | like, what you need is a consistent language that you can use in your team to talk about this stuff. | 比如,你需要的是一个一致的语言 你可以使用在你的团队 谈论这些东西。 |
| 185 | And so I have a little code-based design skill that defines what locality is, defines what | 所以我有一点基于代码的设计技巧 来定义地点,定义什么 |
| 186 | leverage is, defines what a seam is. | 杠杆是,定义什么是接缝。 |
| 187 | I was using seams before they were called. | 在他们被叫来之前我一直在用缝合器 |
| 188 | And what locality | 和哪个地方 |
| 189 | means is kind of how well located together all of the code is. | 意思是所有代码都定位得很好 |
| 190 | How can you change like a small | 你怎么会变小? |
| 191 | change in one module and have it ripple out? | 在一个模块中更改,并有波折吗? |
| 192 | And also leverage is what you get when you have a deep | 杠杆也是你深处得到的 |
| 193 | module. | 模块。 |
| 194 | Because the caller, the person who's actually calling that module, gets a lot of | 因为打电话的人 真正在呼叫那个模块的人 得到很多 |
| 195 | calling a simple function. | 调用一个简单的函数。 |
| 196 | Both of those are very good in code bases. | 两者都非常擅长代码基础. |
| 197 | And good for agents, too, | 对特工也有好处 |
| 198 | it turns out. | 原来如此 |
| 199 | But I'm sort of describing all of these highfaluting coding standards. | 但我正在描述所有这些高脂编码标准。 |
| 200 | But how do | 但怎样 |
| 201 | we actually make sure the agent does them, right? | 我们真的要确保代理 做他们,对不对? |
| 202 | How do you make sure the agent creates deep modules | 您如何确保代理创建深层模块 |
| 203 | and creates good tests and doesn't write these crap tautological ones or structure-sensitive tests? | 并创造良好的测试, 不写这些废话的同义测试 或者结构敏感测试? |
| 204 | Well, I do think most people get this wrong. | 我觉得大多数人都搞错了 |
| 205 | And my first piece of advice is don't put coding | 我的第一点建议是 不要把编码 |
| 206 | standards in your implementer agent. | 执行者代理中的标准。 |
| 207 | Okay? | 好吗? |
| 208 | Let me explain this. | 让我解释一下 |
| 209 | If you imagine the implementer | 如果你想象到执行者 |
| 210 | agent kind of looks like this, where this is all of the things the agent needs to be able to do in | 特工的外表是这样的 这正是特工需要做的 |
| 211 | its single context window. | 它的单个上下文窗口。 |
| 212 | It needs to be able to explore, like to look for the code that it's | 它需要能够探索, 像寻找它的代码 |
| 213 | using. | 使用 。 |
| 214 | And then it needs some budget for actually debugging the thing. | 然后它需要一些预算 实际调试的东西。 |
| 215 | So for running those | 所以,运行这些 |
| 216 | automated checks. | 自动检查。 |
| 217 | For actually checking and verifying that it works. | 为了核实和核实它是否有效 |
| 218 | Now, this is quite a | 现在,这是相当的 |
| 219 | lot of work, it turns out. | 工作很多,结果发现。 |
| 220 | And if you try to impose your coding standards on it as well, | 如果你试图将你的编码标准也强加于它, |
| 221 | it's going to perform worse. | 情况会更糟 |
| 222 | So implementation is overloaded. | 因此,执行工作负担过重。 |
| 223 | That's the mental model I want you to | 这就是我要你做的心理模型 |
| 224 | have. | 有过 |
| 225 | And so can we find a way to impose those coding standards in a way that isn't so overloaded? | 我们能否找到一种方法 以不超载的方式 强制那些编码标准? |
| 226 | Well, this is my effort. | 这是我的努力 |
| 227 | This is my code review skill. | 这是我的代码审查技巧 |
| 228 | And it receives a diff. | 而且它接收一个diff。 |
| 229 | And it reads a | 它读到一个 |
| 230 | file inside the repository called coding standards, which you can write, you can customize. | 在寄存器内的文件名为编码标准,您可以写,也可以自定义。 |
| 231 | And then it checks if the code follows those standards. | 然后它检查密码是否符合这些标准。 |
| 232 | And so if we look at the reviewer | 所以,如果我们看看评论员 |
| 233 | agent here, it also crucially runs it in a subagent. | 这里的特工 也非常需要用副特工操作 |
| 234 | So it's got its own context window | 所以它有自己的上下文窗口 |
| 235 | to kind of handle here. | 给这里的手柄 |
| 236 | It's got its own budget. | 它有自己的预算。 |
| 237 | This one, it needs to do some exploration, right? | 这个,它需要做一些探索,对不对? |
| 238 | Because sure, it receives the diff. | 因为肯定,它接收diff。 |
| 239 | So it knows exactly where it's located, where the code is. | 所以它确切知道它的位置,代码的位置. |
| 240 | But it should probably do a bit of exploration just so it has the wider context, | 但它也许应该做一点 探索 只是因为它有更广泛的背景, |
| 241 | understands the code. | 理解密码。 |
| 242 | But it doesn't need to do any implementation, doesn't need to do any debugging. | 但是它不需要做任何执行,不需要做任何调试. |
| 243 | So while implementation is overloaded, review is actually underloaded. | 因此,虽然执行工作负担过重,但实际上审查负担过重。 |
| 244 | So it doesn't have that | 所以它没有这个 |
| 245 | many jobs to do. | 还有很多工作要做。 |
| 246 | This means you can pile in a bunch of coding standards to it, and it will do a | 这意味着你可以堆成一堆 编码标准它会做一个 |
| 247 | much better job than if you try to do it with implement. | 比你努力执行好得多 |
| 248 | So I think of this, and this is | 所以我想,这是 |
| 249 | uncomfortable, right? | 不舒服,对不对? |
| 250 | Because we all want to be able to just get good code out the first time. | 因为我们都希望 能够只是得到好的代码 第一次。 |
| 251 | But I think of this as the two-part process for writing good code, which is implement, | 但我认为这是两部分的过程 写好代码, 正在执行, |
| 252 | you make it work. | 你让它工作。 |
| 253 | And then code review, you actually make it good. | 然后代码审查, 你实际上使它好。 |
| 254 | You impose your coding | 你强制你的编码 |
| 255 | standards. | 标准。 |
| 256 | And for the retro developers among us, this is essentially a red-green refactor approach. | 对于我们中间的复古开发者来说, 这基本上是一个红绿色的复古方法。 |
| 257 | We use one context window to make it okay, do the red-green, and then we do another context window | 我们用一个上下文窗口来让它好起来,做红绿,然后我们做另一个上下文窗口 |
| 258 | to refactor it. | 来重塑它。 |
| 259 | That's at least how it works in my head. | 至少我脑子里是这样想的 |
| 260 | And it's been very successful for me. | 这对我来说非常成功。 |
| 261 | This means that when you have coding standards, you don't put them in global scope. | 这意味着当你有编码标准的时候,你不会把它们放到全球范围. |
| 262 | You don't | 你没有 |
| 263 | put them in agents.md. | 让他们加入特工 |
| 264 | Because then they sort of drown out your implementer. | 因为他们会淹死你的执行者 |
| 265 | It may read them, | 它可能读到它们, |
| 266 | it may not. | 可能不会 |
| 267 | You put them in coding standards.md. | 你把它们放在编码标准上 |
| 268 | And that way, just the code review agent does it. | 这样,只有代码审查代理才做。 |
| 269 | Now, I've got another idea here, which is I've been talking to lots of people today, | 现在,我还有一个想法,那就是,我今天和很多人谈过了, |
| 270 | lots of people saying, you know, I've been talking about review and automated review, | 很多人说,你知道, 我一直在谈论审查 和自动化审查, |
| 271 | increasing, you know, fixing the PR bottleneck. | 增加,你知道, 修复公关瓶颈。 |
| 272 | So many folks say, oh, yeah, we just use a third | 这么多人说,哦,是的,我们只是用三分之一 |
| 273 | party service. | 派对服务。 |
| 274 | We use Cursor Bug Bot. | 我们使用光圈虫瓶。 |
| 275 | We use Code Rabbit or something like that. | 我们使用代码兔子之类的。 |
| 276 | I think that | 我觉得 |
| 277 | I've really tried to make a generic code review skill in the past that finds all the bugs and | 我过去真的尝试过 做一个通用代码审查技术 找到所有错误和 |
| 278 | does security review and that kind of thing. | 安全审查之类的 |
| 279 | It turns out it's really, really hard. | 事实证明它真的,真的很难。 |
| 280 | Because | 因为 |
| 281 | you either make it too general, and it just gives you false positives that aren't actually | 你要么把它太笼统, 它只是给你 假阳性,其实不是 |
| 282 | relevant to your use case, or you make it too specific. | 和你的用法有关, 或者你把它说得太具体了。 |
| 283 | 你说,好吧,找到所有的TypeScript | |
| 284 | stuff, and then Rust people can't use it. | 东西,然后Rust的人不能使用它。 |
| 285 | So I would say don't outsource automated review. | 所以我说不要外包自动审查。 |
| 286 | Build your own. | 自己盖. |
| 287 | Build up your own coding standards over time. | 逐步建立自己的编码标准. |
| 288 | Share them across your team. | 在你们团队中分享 |
| 289 | And if you have an opportunity to impose coding standards, if you've got some docs sitting | 如果你有机会强制规定编码标准 如果你有医生在场 |
| 290 | around that no one reads, this is the place to put them in. | 没有人读过,这里是放它们的地方。 |
| 291 | And also, when you have this automated | 还有,当你有了这个自动 |
| 292 | reviewer, a really natural inclination for lots of people is to say, oh, yeah, my code review agent, | 评论员,对很多人来说 一个很自然的倾向是, 哦,是的,我的代码审查代理, |
| 293 | what it does is it reads the code, and then it comments on the PR. | 它所做的是读代码,然后评论PR. |
| 294 | So what your code review | 你的代码审查 |
| 295 | agent is doing in that case is it's providing more work for the human reviewer. | 代理正在做在这种情况下是 它为人类审查员提供了更多的工作。 |
| 296 | The human | 人类 |
| 297 | reviewer then has to read all of these verbose comments and figure out, okay, do we implement | 然后,审查者必须阅读所有这些动词评论 并找出,好吧,我们是否执行 |
| 298 | this? | 这个? |
| 299 | Do we implement that? | 我们要执行吗? |
| 300 | The reviewer should commit. | 复审人员应当承诺. |
| 301 | It should make fixes. | 它应该做出修正。 |
| 302 | So it should | 所以应该 |
| 303 | actually change the things that it finds. | 实际改变它发现的东西。 |
| 304 | Because then when the human comes around, | 因为当人类出现时 |
| 305 | you're reviewing a really nice artifact. | 你正在审查一件非常好的艺术品 |
| 306 | If it finds anything that it has any questions over, | 如果发现有问题 |
| 307 | then, of course, it can comment. | 当然,它可以评论。 |
| 308 | But the default should be commits. | 但是,违约应当承担。 |
| 309 | Stop trying to one-shot good | 别再试一枪了 |
| 310 | code. | 代码。 |
| 311 | Stop trying to make the implementer agent the only thing that you do and go, okay, I'm going | 停止试图使执行者代理 你做的唯一,走,好吧,我走了 |
| 312 | to force it to be amazing. | 迫使它变得惊人。 |
| 313 | It takes a little bit of, you know, thinking your way out of there. | 它需要一点点,你知道, 想你的出路在那里。 |
| 314 | But | 不过 |
| 315 | once you realize it, it's fabulous. | 一旦你意识到它, 这是美妙的。 |
| 316 | So, okay. | 所以,还好。 |
| 317 | With all of that process, we've run our automated | 有了这些过程,我们自动运行 |
| 318 | checks. | 检查。 |
| 319 | We've now run our automated review to make sure the automated checks aren't lying. | 我们现在进行自动审查 以确保自动检查不是假的 |
| 320 | How do we then maximize the PR's quality in terms of human review? | 那么我们如何在人文审查方面最大限度地提高公关的质量? |
| 321 | How do we get it, like, | 我们如何得到它,喜欢, |
| 322 | working the best it can? | 尽力而为? |
| 323 | So we need a human-friendly PR. | 所以我们需要一个人性友好的公关。 |
| 324 | And this is a new skill | 这是新技巧 |
| 325 | coming into the repo, which is currently in progress, but I'll be releasing it soon, | 进入重案组, 目前正在进行中, 但我会很快释放它, |
| 326 | which is the PR skill. | 这是公关技术。 |
| 327 | This is one I've been mulling over for a long, long time, | 我很久以来一直在想这个 |
| 328 | haven't quite figured out what the state of the art is. | 还没有完全明白什么是 艺术状态。 |
| 329 | And I've realized the best way to | 我意识到最好的办法 |
| 330 | make a PR skill is just to steal all the best ideas that everyone's got. | 做一个公关技术只是 窃取所有最好的 想法,每个人都有。 |
| 331 | And it's very nice. | 且道甚处来. |
| 332 | Now, what does a good PR body look like? | 现在,一个良好的公关身体是什么样子? |
| 333 | How would you recreate this skill on your own? | 你怎么自己再创造这种技能? |
| 334 | Well, | 那个 |
| 335 | the first principle is some reviews are more important than others. | 第一项原则是,有些审查比其他审查更重要。 |
| 336 | Not every review is | 并不是每个审查都是 |
| 337 | essential, right? | 关键,对不对? |
| 338 | And once you understand this, you realize, okay, that means I can focus my energy | 一旦你明白这一点, 你意识到,好吧, 这意味着我可以集中我的能量 |
| 339 | on the really important reviews. | 关于真正重要的审查。 |
| 340 | But how do we categorize that? | 但我们怎么分类呢? |
| 341 | Well, you've got to think about | 你该想想 |
| 342 | the PR as using this AWS terminology, which is, is it a one-way door or is it a two-way door? | 公关是使用这种AWS术语,也就是说,是单向门还是双向门? |
| 343 | Now, most PRs that you have will be two-way doors. | 现在,你拥有的大多数公关将是双向的门。 |
| 344 | You can merge the PR and then always pull it | 你可以合并公关 然后总是拉它 |
| 345 | back later. | 回头再说 |
| 346 | It's the glorious benefit of being a software engineer as opposed to a civil engineer, | 作为软件工程师而不是土木工程师的光荣好处 |
| 347 | right? | 对吧? |
| 348 | Mostly when you're a civil engineer, it's a one-way door, right? | 主要是当土木工程师的时候,是单向门,对吗? |
| 349 | If you get something wrong, | 如果你搞错了 |
| 350 | that bridge is going down. | 桥要塌了 |
| 351 | But if you have a two-way door, it means that you can easily | 但如果你有一个双向门, 这意味着你可以轻松 |
| 352 | revert the change. | 退回更改。 |
| 353 | Now, that might be a bit more nuanced than you might expect. | 这也许比你想象的要细微些 |
| 354 | It might be that a | 这可能是一个 |
| 355 | very simple change accidentally blasts out an email to 60,000 people or something, in which case | 很简单的改变 意外地向六万人发邮件 |
| 356 | that is a one-way door. | 这是单向的门。 |
| 357 | You want to review that very, very carefully. | 你想非常非常仔细地审查一下 |
| 358 | It involves expensive | 费钱的 |
| 359 | migrations or data loss. | 迁移或数据损失。 |
| 360 | That is a one-way door. | 这是一个单向的门。 |
| 361 | Review the hell out of that PR. | 从公关里检查一下 |
| 362 | But also, tied | 还有,捆绑 |
| 363 | onto that, we need to understand the blast radius of this PR. | 我们需要了解这个公关的爆炸半径 |
| 364 | What can go wrong? | 怎么会出问题? |
| 365 | And if things do | 如果事情发生 |
| 366 | wrong, how bad is it? | 错了,有多糟? |
| 367 | And this means I end up with a nice little sort of summary right at the bottom | 这说明我最后在底部有个小的总结 |
| 368 | of all of my PRs, which is the merge danger. | 我所有的公关, 这就是合并的危险。 |
| 369 | I can see this one is a two-way door. | 可见此二门. |
| 370 | Its blast | 它的爆炸声 |
| 371 | radius is localized. | 半径是局部的。 |
| 372 | And so I can see, fantastic, I don't need to pay that much attention to this. | 因此我可以看到,太棒了,我不需要 关注这个。 |
| 373 | I'm just going to sort of review it a little. | 我只是来看一下 |
| 374 | That's really important. | 这很重要 |
| 375 | Next, we need to understand | 接下来,我们需要了解 |
| 376 | what the PR is even doing, right? | 公关在干嘛? |
| 377 | And I've tried lots of different ways of figuring this out. | 我尝试了很多不同的方法来找出来。 |
| 378 | And | 还有 |
| 379 | the best thing I've come up with is using pseudocode. | 最好的办法就是用假密码 |
| 380 | Now, a huge point of gratitude here to the | 现在,一个巨大的 感谢在这里, |
| 381 | show me skill from the human layer skills repo by Dex Hawley. | 展示一下Dex Hawley从人类层面获得的技能 |
| 382 | This is a phenomenal skill that just | 这是一个惊人的技巧,只是 |
| 383 | essentially dispenses with most text and shows things to you in images and diagrams instead. | 主要是去除大多数文本,然后在图像和图表中向您显示。 |
| 384 | This makes it a lot easier to grasp actually what's changing and why it's changing. | 这使得人们更容易理解什么在变化,为什么在变化。 |
| 385 | So you get the kind of standard sort of set of like mermaid diagrams and UML for, you know, | 所以,你得到的标准类型 类像人鱼图 和UML的,你知道, |
| 386 | this is a sort of sequence of things that happened. | 这是发生的一系列事情。 |
| 387 | You also just get these lovely simple ones like | 你也只是得到这些可爱的简单 喜欢 |
| 388 | this, for instance. | 比如说这个 |
| 389 | We can look at this and go, okay, we're working in a CLI. | 我们可以看看这个,然后走, 好吧,我们正在工作 在CLI。 |
| 390 | We can see a new | 我们可以看到新的 |
| 391 | command has been added. | 命令已被添加。 |
| 392 | And we've got two new things, little flags up the top here, just little | 上面有两面新旗子 |
| 393 | summaries like this. | 像这样的总结。 |
| 394 | It really does make a massive difference. | 这确实有很大的区别。 |
| 395 | It's hard to overstate. | 难为过分. |
| 396 | So you're trying to, like, make understanding the why as fast as possible. | 所以,你试图一样, 使理解为什么 尽可能快。 |
| 397 | And I think a third | 我想还有第三个 |
| 398 | principle here is something you should be thinking about whenever you do human review. | 这里的原则是,每当你做人检讨时,你都应该考虑一些事情。 |
| 399 | Because we're | 因为我们是 |
| 400 | not doing, like, because our processes now are so sort of streamlined and all we're all collaborating | 不这样做,像,因为我们现在的程序 如此精简 和我们所有的合作 |
| 401 | around these same skill files, these same steering files. | 围绕这些相同的技能文件, 这些相同的方向文件。 |
| 402 | We're all building an environment for our | 我们都在为我们创造环境 |
| 403 | agents to operate in together. | 探员要一起行动 |
| 404 | You should think of the process that produces your code as just as | 你该想想产生代码的过程 |
| 405 | important as the code itself. | 代码本身很重要 |
| 406 | In other words, when you do a human review, you're not just reviewing | 换句话说,当你做人文审查时, 你不只是审查 |
| 407 | the code, you're reviewing the system that creates it. | 代码,你正在审查创建它的系统。 |
| 408 | And the theory here is that you never want to | 这里的理论是 你永远不想 |
| 409 | write the same comment twice, right? | 写同样的评论两次,对不对? |
| 410 | You never want to catch the agent doing the same thing | 你从来就不想抓到做同样工作的探员 |
| 411 | over two PRs. | 超过两个公关。 |
| 412 | And so what's the mechanism by which you can make your human review matter? | 那么,你可以用什么机制 让你的人类审查重要? |
| 413 | Well, this is a new skill. | 嗯,这是一个新的技能。 |
| 414 | This is called retro. | 这叫做复古。 |
| 415 | Retro for retrospective. | 反省回顾. |
| 416 | You essentially take a | 你基本上拿一个 |
| 417 | session that you've done. | 你做错什么了 |
| 418 | It can either be like a single agent session or it can be a PR plus the | 可以是单一的代理会话 也可以是公关+ |
| 419 | session or you can just get it to look at, okay, look at all of the PRs that we've done over the | 或者你可以让它看看, 好吧,看看所有的公关 我们已经完成了 |
| 420 | last week, all of the reviews, pull them all in. | 上周,所有的评论, 把他们全部拉进来。 |
| 421 | Let's do a retrospective on them. | 我们来回顾一下 |
| 422 | And it will | 它会 |
| 423 | suggest automated checks and coding standards to make the next one better. | 建议自动检查和编码标准,使下一个标准更好。 |
| 424 | So this is the | 所以这是 |
| 425 | compounding effect where you essentially, by doing human review, you're making the quality of | 在你基本上通过做人文审查 使质量达到 |
| 426 | the next human review higher. | 下一次人类评论会更高 |
| 427 | And you're sort of saving less work from yourself next time. | 下次你还省了点工作 |
| 428 | And retro is a really smart skill. | 复古是一种非常聪明的技能。 |
| 429 | It adds a bunch of stuff. | 它增加了一堆东西。 |
| 430 | So obviously, it suggests automated | 很明显,它暗示自动化 |
| 431 | checks. | 检查。 |
| 432 | It suggests updates to coding standards. | 它建议更新编码标准。 |
| 433 | It does other smart stuff, too. | 它做其他聪明的东西,太。 |
| 434 | So it looks at | 所以它看着 |
| 435 | navigation pointers. | 导航指针。 |
| 436 | How easily did the agent find its information? | 探员有多容易找到信息? |
| 437 | Can we provide a pointer | 我们能提供指针吗? |
| 438 | inside agents.md to help it out next time? | 内线MD来帮助它下一次? |
| 439 | It looks at tool economy. | 它看的是工具经济. |
| 440 | Are there different tools | 有没有不同的工具 |
| 441 | that we're using in the session that can, you know, could be made more token efficient? | 我们在会话中使用的, 你知道,可以使 更象征性的效率? |
| 442 | It's | 这是 |
| 443 | amazing how many things this catches, actually, because those are often really hard to debug from | 令人惊奇的是,实际上有多少事情, 因为那些往往是很难调试的 |
| 444 | the outside. | 外边 |
| 445 | It just looks at bloat as well. | 它也只是看血肿。 |
| 446 | So are there bloated steering files? | 那么有没有膨胀的引导文件? |
| 447 | Are there bloated | 是否有胀 |
| 448 | skills that contribute to these bad results? | 导致这些不良结果的技巧? |
| 449 | Can we make them more organized? | 我们能让他们更有条理吗? |
| 450 | So that's the goal, | 这就是目的 |
| 451 | to make human review faster. | 让人类评论更快 |
| 452 | We do that by layering up automated checks. | 我们这样做是通过分层自动检查。 |
| 453 | We're layering up | 我们正在分层 |
| 454 | automated review. | 自动审查。 |
| 455 | And we make the human review as painless, as simple, and as kind of optional as | 我们让人类的检讨 变得无痛无痛 简单 |
| 456 | we need it to. | 我们需要它。 |
| 457 | You really don't need to review every single two-way door. | 你真的不需要审查每个双向门 |
| 458 | Every single one-way | 每个单向 |
| 459 | door you do. | 门你做。 |
| 460 | So these are my skills. | 这些是我的技能。 |
| 461 | Aihero.dev前锋刀术。 | |
| 462 | I'm shipping version 1.3 | 我在运输1.3版 |
| 463 | this week. | 这周 |
| 464 | It's been glorious hanging out with you. | 跟你在一起真是光荣 |
| 465 | It's been a really nice conference. | 这是一个非常好的会议。 |
| 466 | I'm | и琌 |
| 467 | happy to have a chat. | 很高兴有聊天。 |
| 468 | Thank you so much for having me. | 谢谢你邀请我 |
| 469 | Thank you, Paris. | 谢谢你,巴黎。 |
该视频共有字幕 469 条。解锁更多字幕为会员功能,请移动到 价格
