Dan Luu 写系统问题时,习惯先测量、再对照、最后才下结论。把「Advantages of monorepos」放到智能体、评测和线上系统里,真正要问的是:默认做法会不会系统性失败。下面用中文整理成可执行的工程笔记,去掉原站导航和无关链接。
Simplified organization
Someone : Did you hear that Facebook/Google uses a giant monorepo? WTF! Me : Yeah! It's really convenient, don't you think? Someone : That's THE MOST RIDICULOUS THING I've ever heard. Don't FB and Google know what a terrible idea it is to put all your code in a single repo? Me : 一个稳妥判断是 engineers at FB and Google are probably familiar with using smaller repos (doesn't Junio Hamano work at Google?), and they still prefer a single huge repo for [reasons]. So
“[reasons]” is pretty long, so I'm writing this down in order to avoid repeating the same conversation over and over again.
Simplified dependencies
With multiple repos, you typically either have one project per repo, or an umbrella of related projects per repo, but that forces you to define what a “project” is for your particular team or company, and it sometimes forces you to split and merge repos for reasons that are pure overhead. For example, having to split a project because it's too big or has too much history for your VCS is not optimal.
With a monorepo, projects can be organized and grouped together in whatever way you find to be most logically consistent, and not just because your version control system forces you to organize things in a particular way. Using a single repo also reduces overhead from managing dependencies.
Tooling
A side effect of the simplified organization is that it's easier to navigate projects. The monorepos I've used let you essentially navigate as if everything is on a networked file system, re-using the idiom that's used to navigate within projects. Multi repo setups usually have two separate levels of navigation — the filesystem idiom that's used inside projects, and then a meta-level for navigating between projects.
A side effect of that side effect is that, with monorepos, it's often the case that it's very easy to get a dev environment set up to run builds and tests. If you expect to be able to navigate between projects with the equivalent of cd , you also expect to be able to do cd; make . Since it seems weird for that to not work, it usually works, and whatever tooling effort is necessary to make it work gets done 1 . While it's technically possible to get that ki
Cross-project changes
This probably goes without saying, but with multiple repos, you need to have some way of specifying and versioning dependencies between them. That sounds like it ought to be straightforward, but in practice, most solutions are cumbersome and involve a lot of overhead.
With a monorepo, it's easy to have one universal version number for all projects. Since atomic cross-project commits are possible (though these tend to split into many parts for practical reasons at large companies), the repository can always be in a consistent state — at commit #X, all project builds should work. Dependencies still need to be specified in the build system, but whether that's a make Makefiles or bazel BUILD files, those can be checked int
Mercurial and git are awesome; it's true
The simplification of navigation and dependencies makes it much easier to write tools. Instead of having tools that must understand relationships between repositories, as well as the nature of files within repositories, tools basically just need to be able to read files (including some file format that specifies dependencies between units within the repo).
This sounds like a trivial thing but, take this example by Christopher Van Arsdale on how easy builds can become:
Downsides
The build system inside of Google makes it incredibly easy to build software using large modular blocks of code. You want a crawler? Add a few lines here. You need an RSS parser? Add a few more lines. A large distributed, fault tolerant datastore? Sure, add a few more lines. These are building blocks and services that are shared by many projects, and easy to integrate. … This sort of Lego-like development process does not happen as cleanly in the open sour
The system that Arsdale is referring to is so convenient that, before it was open sourced, ex-Google engineers at Facebook and Twitter wrote their own versions of bazel in order to get the same benefits.
落地时建议先做的 5 件事
- 用自己的真实负载测,而不是只用公开榜或厂商数字。
- 把评测设计成能抓到失败模式:平均分好看但尾部崩溃,仍然算失败。
- 智能体默认不会好好用测试;要写进流程,而不是写在口头规范里。
- 性能和正确性都要有基线,改模型或改语言前后必须能对比。
- 结论写成可回滚的决策:哪一版配置、哪一版评测集、谁签字。
和智能体产品怎么接
龙虾PRO做 OpenClaw 落地时,同样吃「先测量再扩面」这条纪律:技能、数字员工和网关都要有可复现评测,而不是只看一次演示通过。
本文侧重全链路风控方法论。落地时请用自身业务单据做回放验证,不要把示例阈值直接当生产策略。 相关:风控体检 · 方案资源
常见问题 FAQ
什么是AI智能系统?
「AI智能系统」可概括为:Someone : Did you hear that Facebook/Google uses a giant monorepo? WTF! Me : Yeah! It's really convenient, don't you think? Someone : That's THE MOST RIDICULOUS THING I've ever hea 本文从定义、方法与实践要点展开说明。
为什么要关注AI智能系统?
关注AI智能系统,是因为它直接影响效率、风险与可复制性。文中指出:Someone : Did you hear that Facebook/Google uses a giant monorepo? WTF! Me : Yeah! It's really convenient, don't you think? Someone : That's THE MOST RIDICULOUS THING I've ever heard. Don't FB and Google know what a terri…
如何落地AI智能系统?有哪些关键步骤?
建议按以下路径推进AI智能系统:1) 用自己的真实负载测,而不是只用公开榜或厂商数字。;2) 把评测设计成能抓到失败模式:平均分好看但尾部崩溃,仍然算失败。;3) 智能体默认不会好好用测试;要写进流程,而不是写在口头规范里。;4) 性能和正确性都要有基线,改模型或改语言前后必须能对比。;5) 结论写成可回滚的决策:哪一版配置、哪一版评测集、谁签字。。细节见正文对应章节。
AI智能系统适合哪些人或团队?
AI智能系统更适合:产品/技术负责人、运营与增长团队、需要落地智能体或自动化的中小团队、关注「AI智能系统」方向的读者。若你只需要单次聊天式问答,可先读概念;若要上生产,请重点看步骤、权限与风控相关段落。
关于「Simplified organization」,本文给出了什么结论?
在「Simplified organization」部分,要点是:d. Don't FB and Google know what a terrible idea it is to put all your code in a single repo? Me : 一个稳妥判断是 engineers at FB and Google are probably familiar with using smaller repos (doesn't Junio Hamano work at Google?),
实践AI智能系统时常见误区有哪些?
常见误区包括:① 只追工具不建流程;② 没有权限/审计边界就上生产;③ 缺少指标与回滚方案;④ 把演示效果当成稳定 SLA。针对AI智能系统,请以正文中的检查清单与约束条件为准,小范围验证后再扩面。