Dan Luu 写系统问题时,习惯先测量、再对照、最后才下结论。把「Files are fraught with peril」放到智能体、评测和线上系统里,真正要问的是:默认做法会不会系统性失败。下面用中文整理成可执行的工程笔记,去掉原站导航和无关链接。

File API

This is a psuedo-transcript for a talk given at Deconstruct 2019. To make this accessible for people on slow connections as well as people using screen readers, the slides have been replaced by in-line text (the talk has ~120 slides; at an average of 20 kB per slide, that's 2.4 MB. If you think that's trivial, consider that half of Americans still aren't on broadband and the situation is much worse in developing countries.

Let's talk about files! Most developers seem to think that files are easy. Just for example, let's take a look at the top reddit r/programming comments from when Dropbox announced that they were only going to support ext4 on Linux (the most widely used Linux filesystem). For people not familiar with reddit r/programming, I suspect r/programming is the most widely read English language programming forum in the world.

Filesystem

I'm a bit confused, why do these applications have to support these file systems directly? Doesn't the kernel itself abstract away from having to know the lower level details of how the files themselves are stored?

The only differences I could possibly see between different file systems are file size limitations and permissions, but aren't most modern file systems about on par with each other?

Disk

The #2 comment (and the top replies going two levels down) are:

#2: Why does an application care what the filesystem is?

Corollaries

#2: Shouldn't that be abstracted as far as "normal apps" are concerned by the OS?

Reply: It's a leaky abstraction. I'm willing to bet each different FS has its own bugs and its own FS specific fixes in the dropbox codebase. More FS's means more testing to make sure everything works right . . .

FAQ

2nd level reply: What are you talking about? This is a dropbox, what the hell does it need from the FS? There are dozenz of fssync tools, data transfer tools, distributed storage software, and everything works fine with inotify. What the hell does not work for dropbox exactly?

another 2nd level reply: Sure, but any bugs resulting from should be fixed in the respective abstraction layer, not by re-implementing the whole stack yourself. You shouldn't re-implement unless you don't get the data you need from the abstraction. . . . DropBox implementing FS-specific workarounds and quirks is way overkill. That's like vim providing keyboard-specific workarounds to avoid faulty keypresses. All abstractions are leaky – but if no one those

Conclusion

In this talk, we're going to look at how file systems differ from each other and other issues we might encounter when writing to files. We're going to look at the file "stack" starting at the top with the file API, which we'll see is nearly impossible to use correctly and that supporting multiple filesystems without corrupting data is much harder than supporting a single filesystem; move down to the filesystem, which we'll see has serious bugs that cause d

Let's say we want to write a file safely, so that we don't want to get data corruption. For the purposes of this talk, this means we'd like our write to be "atomic" — our write should either fully complete, or 工程上应当 be able to undo the write and end up back where we started. Let's look at an example from Pillai et al., OSDI’14.

值得单独记下的观察

  • Make a copy of the entire file
  • Rename the copy on top of the original file

落地时建议先做的 5 件事

  1. 用自己的真实负载测,而不是只用公开榜或厂商数字。
  2. 把评测设计成能抓到失败模式:平均分好看但尾部崩溃,仍然算失败。
  3. 智能体默认不会好好用测试;要写进流程,而不是写在口头规范里。
  4. 性能和正确性都要有基线,改模型或改语言前后必须能对比。
  5. 结论写成可回滚的决策:哪一版配置、哪一版评测集、谁签字。

和智能体产品怎么接

龙虾PRO做 OpenClaw 落地时,同样吃「先测量再扩面」这条纪律:技能、数字员工和网关都要有可复现评测,而不是只看一次演示通过。

效率龙虾 会带着下面这段开聊

按文章《文件操作充满陷阱》把卡点收成可执行步骤:先做什么、别踩哪条、怎么验证。

用效率龙虾试这篇

本文侧重全链路风控方法论。落地时请用自身业务单据做回放验证,不要把示例阈值直接当生产策略。 相关:风控体检 · 方案资源

常见问题 FAQ

什么是AI智能系统?

「AI智能系统」可概括为:This is a psuedo-transcript for a talk given at Deconstruct 2019. To make this accessible for people on slow connections as well as people using screen readers, the slides have bee 本文从定义、方法与实践要点展开说明。

为什么要关注AI智能系统?

关注AI智能系统,是因为它直接影响效率、风险与可复制性。文中指出:This is a psuedo-transcript for a talk given at Deconstruct 2019. To make this accessible for people on slow connections as well as people using screen readers, the slides have been replaced by in-line text (the talk has ~120 slides; at an averag…

如何落地AI智能系统?有哪些关键步骤?

建议按以下路径推进AI智能系统:1) Make a copy of the entire file;2) Rename the copy on top of the original file;3) 用自己的真实负载测,而不是只用公开榜或厂商数字。;4) 把评测设计成能抓到失败模式:平均分好看但尾部崩溃,仍然算失败。;5) 智能体默认不会好好用测试;要写进流程,而不是写在口头规范里。。细节见正文对应章节。

AI智能系统适合哪些人或团队?

AI智能系统更适合:产品/技术负责人、运营与增长团队、需要落地智能体或自动化的中小团队、关注「AI智能系统」方向的读者。若你只需要单次聊天式问答,可先读概念;若要上生产,请重点看步骤、权限与风控相关段落。

关于「File API」,本文给出了什么结论?

在「File API」部分,要点是:replaced by in-line text (the talk has ~120 slides; at an average of 20 kB per slide, that's 2.4 MB. If you think that's trivial, consider that half of Americans still aren't on broadband and the situation is much worse

关于「Filesystem」,本文给出了什么结论?

在「Filesystem」部分,要点是:the files themselves are stored? The only differences I could possibly see between different file systems are file size limitations and permissions, but aren't most modern file systems about on par with each other? Disk