← eli5

A picture story about a very fast mistake

The Robot's Notebook

There is a robot that reads every file we write and points out the mistakes. It kept a notebook so it wouldn't have to read everything twice. For a long time, the notebook did nothing at all.

01

The robot reads every single file.

reads all of them 4,000 files 17 seconds
Reading everything is correct, and slow.
02

So it keeps a notebook: “this one was fine.”

Next time, it only reads the files that changed. Seventeen seconds becomes three.

writes skips reads only this one
The notebook is the whole trick: skip what hasn't changed.
03

But the notebook was thrown away every time.

The robot works on a fresh borrowed desk for each job, and the desk is wiped when it leaves. So the notebook never survived to the next run — and the robot started from zero, forever.

run 1 run 2 run 3 empty empty empty nothing is ever carried forward
The notebook existed. It just never lived long enough to be read.
04

We saved the notebook. It still didn't work.

Because of what the robot wrote down. Next to each file it noted what time the file was last touched — not what was inside it. And copying the code to a fresh desk stamps every file with the time it was copied. Four thousand files, all looking brand new.

notes the TIME copied to a fresh desk two different times “changed!” reads all 4,000 again notes the INSIDES copied to a fresh desk same fingerprint “same!” skips all 4,000
Copying changes when a file was touched. It doesn't change what's in it.
05

And two robots were sharing one notebook.

One robot checks one kind of file, another robot checks a different kind — at the same time, on the same desk. Both wrote into the same notebook, and whoever finished last wiped out the other one's pages. We opened the notebook and one robot's work was simply gone.

one notebook one each .ts .vue .ts .vue last one wins, the other is erased .ts .vue .ts .vue both survive
Two writers, one page: the second one always won. Nobody noticed, because nothing broke — it was just slow.
06

Now the notebook lives in a locker.

One robot fills it in after the work is merged, and puts it away. Every robot after that borrows a copy instead of starting empty. Nobody else is allowed to write in it — one writer, many readers, so it can't get scribbled over.

after merge (only writer) saves the locker borrows a copy every later job
One writer, many readers. A borrowed copy can't be scribbled over by the borrower.
before
17s
after
3smeasured on one folder, after all three fixes
Write down the insides, not the timeOne flag: --cache-strategy content. Without it, a fresh copy of the code looks 100% new and the notebook is useless.
Give each robot its own notebook--cache-location per checker. Two checkers, one file: the second one erased the first. The proof was a notebook with zero .vue pages in it.
Keep the notebook in a lockerSaved once after each merge, borrowed by every job after that. Only one job is allowed to write, so it can't be scribbled over or half-filled.

The tool is ESLint, the notebook is .eslintcache, and the locker is GitHub Actions cache. The flag had been switched on the whole time — it just had nothing to remember with, nowhere to live, and two writers fighting over it.