catforest
← ノート
方法論他の言語中文

Write the rule into a file, and the AI follows it

On 28 July I wrote a method document for feature ledgers. It started with a feature of my own that didn't work.

yPulse had just gained a "readiness" page that listed, for every project, what was built and what wasn't. As soon as I used it I found that I was the one who had to fill the list in, and I couldn't even list everything for a project like yAssets. I had been part of building every feature, but having been there and being able to recite them on demand are two different kinds of memory. I wrote in the document that the person is the most expensive and least reliable part of this system, and that status shouldn't depend on my memory.

Its first principle is that status must change as a by-product of the work, never as a task of its own. Offices that manage many projects at once learned long ago that any status system people have to fill in separately ends up either faked or abandoned, because reporting and working are different jobs.

So the ledger lives in each project's own repository, next to the code. Most of my work is done by AI sessions, and every repository's instructions say: when you finish a feature, change its ledger entry in the same commit. At release time the ledger is checked again, and if it doesn't match what's being released, the release stops. Every night yPulse collects all the ledgers; it only validates them and never makes up anyone's status. There are 27 ledgers in the matrix now, and yLookbook's has 282 entries.

The ledgers have broken things too. Once, in a yLookbook release, one entry had a category that wasn't in the agreed vocabulary, and the check on the yPulse side that collects ledgers stayed red for a morning. yLookbook now has a script that checks its ledger before every release. yPulse has the same check to run before a ledger is pushed, because a ledger that fails to parse silently drops its whole repository out of the nightly sync.

The way pages are built was written down the same way. In August I wrote a run of page rules: data tables on 9 August, forms on 16 August, and the next day feedback, one shared vocabulary for notices, loading, empty and error states. The originals live in yBlocks, my component library, and are copied into every project. Each project's instructions carry a table: first decide which kind of page you're building, then read that kind's rule and assemble it from the existing components. Building the frame by hand isn't allowed.

Releases are written down too. Every repository has a release card that says where its version number lives, which commands gate a release, where it ships and how to check it once it's live. I say "release", and the dozen steps after that follow the card. Everything on a card has been tested in practice. yLookbook's build, for example, used to fail on downloading fonts. Once, deleting the cache and retrying failed seven times in a row; rerunning without deleting it passed in 31 seconds. That sentence is on the card now, so the next session doesn't have to try seven times.

Some rules were forced on me by accidents, and they live in my global instructions, which every session reads first. I run local servers for several projects in the matrix at once, and more than once a session ended processes by name and took every one of them down; it happened three or four times. The rule now is that a session may only end processes it started itself, by their ID, and nobody else's. Another rule splits how work is wrapped up. My day-job project gets pull requests; the side projects get commits and no pull requests. Across nearly two hundred releases on the side projects there was exactly one pull request, opened by an AI following the day-job routine. Since then the two routines are written out separately in the instructions, and every step says which one it belongs to.

Numbers from the platforms take the same route. On 7 October Bilibili's dashboard showed three episodes of The Order Beneath losing over 30% of viewers in the first three seconds, against a median of 24.7%. I didn't stop at "make openings better from now on". I wrote a script that measures the first three seconds of every exported film, and a film that doesn't move within its first second doesn't ship. That script has since moved into yReel, where several repositories share it.

My reason is simple. Every AI session starts from nothing, and what I said in chat is gone in the next one. A rule written into a file is read before the next session starts work, and it doesn't lapse because one day I forgot to mention it.

Last weekend I found that I had marked more than a dozen YouTube videos as "made for kids", which left them with almost no views. After fixing them I wrote it into the YouTube publishing runbook, and the form-filling script now reminds me which audience to choose before it hands the page over.