Factory diary

Chapter 03 ·

I went to sleep and woke up to the work done

The first full night: a roadmap in stages, not a single prompt from me, and 10 tasks delivered, tested and merged by morning.

⏱️ 8 min read

In the previous chapter, AI took the wheel from me during the day. I started defining, following and approving, and the tool did the rest. At night, though, the factory still depended on me: when I went to bed, it stopped.

This chapter is about the first night that did not happen.

The rehearsal

The first attempt was the night before. It was past midnight when I started the first run with two tasks grouped together and went to bed.

The run finished fine, at 1:42 am. After that, the machine stopped, because there was nothing left in the queue. I woke up to two finished tasks and a computer that had been idle for more than six hours.

For the machine to work the whole night, someone had to organize the night beforehand: what runs, in what order, what can run together and what cannot. During the day, that someone was me, between one session and the next. At night, there was nobody.

The first night's roadmap

That someone arrived the next day: the AI Product Owner from chapter 2, still in a much simpler version. And the PO was delivered by the tool itself. The run that built the PO finished at 9:21 pm. Four minutes later, the first stage of the first roadmap it put together started.

There were seven stages. For the ones after midnight, the PO paired tasks that did not touch the same files, so they could run at the same time, in two lanes. The last two stages were different: each one grouped two screen tasks into a single run, because they touched the same places.

Every task was in Automatic mode, the screen ones included: from code to merge, without stopping for me to look.

The night almost did not start. At 10:23 pm, a second copy of the app, opened by mistake, scrambled the roadmap, and it stopped. The AI fixed the file, and at 10:47 pm the roadmap was running again. I told that scare in chapter 1, and it has a chapter of its own: A system AI can read is a system AI can fix (chapter 8).

Hour by hour

At 11:30 pm the third stage started. Shortly after, I sent Claude my last message of the night:

"Cancel the monitor, I'm going to sleep and leaving the PC running."

The monitor was Claude following the runs for me. I cancelled it so I would not spend an AI watching another AI work while I slept. That idea comes back in chapter 5, The most expensive token is the one of an AI waiting.

After that, I did not send a single message until seven in the morning. What happened in between I only saw in the morning, in the logs.

The first night, from 11 pm to 9 am: two lanes of runs, stage by stage, from 11:30 pm to 4:02 am; the second lane waiting for the first to finish in each stage; the machine idle for 4h45, until I opened the next stage at 8:47 am; and not one message from me between midnight and seven

The logs showed a detail I had not foreseen: each stage only started when the previous one had finished entirely. At 12:25 am, one of the lanes was free and waited 24 minutes for the other. The night moved at the pace of the slowest run in each stage.

What the factory built while I slept

Looking at the list in the morning, one thing caught my attention: everything the factory built that night was for itself. And much of it was exactly what it lacked to work without me:

The tool spent the night building the tools that would let me sleep. Run App, which I use today to approve a screen, was built without me, at three in the morning.

In the morning

The night's result:

What I felt that morning is recorded in a conversation with the AI:

"Thinking about the agile philosophy, it seemed much better to me to go to sleep and wake up to proposals already merged, where I can refine on top of what has already been done."

Instead of imagining a screen before it existed, I had the screen ready to judge. That idea has a chapter of its own: Refine first or react later? (chapter 7).

The morning also showed a risk. The last stage used the screen rules and components created in the stage before. If I did not like the 2:33 am work, the fix would not stay in it alone, because there was already work resting on top. On a night with nobody watching, the cost of getting a screen wrong grows with each stage. The rule that stuck: at night, screens can go on Automatic, but without stacking screens that depend on each other in the same night.

And the morning review has to fit in one hour. Ten deliveries only fit in that time if each one arrives with evidence: captures, logs and the app running in one click. Without that, I would spend the morning reading code.

At 8:47 am, I opened the next stage. The first task of the day was the definitive fix for the 10:23 pm scare: a single copy of the app per working folder.

The numbers for those 24 hours also had a less pretty side. I sent 76 messages, spread over 12 different hours, and 23 of them were at ten at night, fixing the roadmap. After midnight, the factory worked without me. During the day, I was still far from the two hours.

The 4h45 idle

Adding up the 24 hours, from eight in the morning to eight in the morning, the factory had some run going for almost 15 hours. The day before, it had been just over 7.

The number that bothered me most was another one. From 4:02 am to 8:47 am, the machine sat idle for 4 hours and 45 minutes. It did not fail, did not hang and did not wait for an approval. It simply had no more planned work.

That is when I wrote a sentence that became a principle of the project:

"A good developer doesn't sit idle. When the backlog he had runs out, he goes looking for more or asks the PO, and the PO keeps pushing work."

That gap became three tasks:

The living roadmap was not ready yet the next night. So, with the AI's help, I tacked three small stages onto the end of the roadmap by hand, just so the machine would not stop. It did not stop: about 25 tasks by seven in the morning.

The metric changed too. For a 24/7 factory, the most important question may not be how many tasks it delivers per night, but how many hours of well-defined work are ready when I go to bed. One day, I want to open the backlog and read: "five nights of work ready".

The approval moved to another time

No run stopped to ask for my approval that night. That does not go against the project's rule. The approval did not disappear: it moved to another time. The roadmap I accepted before going to bed already said what could go in without me, in what order and in which mode.

When a task needs me, the night waits. The following night, a task reached a point where the workflow requires my approval and sat for more than two hours, waiting for me to wake up.

The rule is the same as in the previous chapters: automation never crosses a human approval.

The next step

When I added up the time of the stages that night, something did not add up. Testing took longer than developing: about 3h15 against 2h10. And 1h20 of that testing was an agent waiting for a command to finish.

In the next chapter, The bottleneck isn't the code, it's the tests (chapter 4), I tell why writing code stopped being the expensive part of the work, and what I changed so the following nights would not spend the clock waiting.

Next chapterThe bottleneck isn't the code, it's the testsAdding up the time of each step, testing took longer than development. The next big saving is in testing. ← All chapters

Newsletter

Get the next chapters.

One email when a new chapter is out. No spam, unsubscribe anytime.