Loaded Nine Lessons Learned
Written later and filed to this date, as part of filling in every day of the year.
The commit is from a December Tuesday, two days after the agent-runner repository began, and its subject is “Add comprehensive error fixing with lessons learned system”. The body is six bullets. “Added lessons learned persistence (.agent-factory/lessons-learned.json)”. “Documents all error fixes (TypeScript, test, build, runtime)”. “Uses past lessons to improve future fix suggestions”. And last: “Loads and saves lessons across sessions”. One file, 264 lines added.
The mechanism is exactly what the bullets say. On construction the builder reads the JSON file and prints Loaded N lessons learned. After a fix succeeds it appends a record: the improvement it was attempting, the error type, the error text, and the fix. It keeps the last hundred. When a new error arrives it looks for past lessons of the same type whose message resembles this one, and pastes their fixes into the next prompt under the heading “Lessons from past successful fixes”.
What the author understood is real. Errors recur, and a fix that worked once is cheap to remember. It arrived with two siblings, four minutes earlier: one that rolls back a failed improvement with a checkout and tracks it so it is not tried again, and one that lets the builder retry a type error up to three times. By 16:21 the builder could fail, remember failing, and fix its own mistakes with help from its past.
Fourteen minutes later it began. Five commits that evening carry one subject, “Context Window Management - P0 Critical Fix”: the first writes a six-hundred-line file, and the next four each rewrite most of it. Two hundred and ninety lines in, four hundred and ninety-five out; then three hundred and thirty-one in, two hundred and eighty-five out.
The lessons file is gitignored, so it never left this machine, but the machine still has it. Nine lessons, all of type typescript. The first is stamped two minutes after the commit that created the file and twelve before the builder’s first, and names the same improvement. Its fix lists first “Removed non-existent ‘Session’ import”: the builder had imported something it had invented, and learned, durably, how to stop. The last lesson is dated the next evening. Then the file stops.
What the author missed is in the word “successful”. A lesson was recorded only when a fix worked, and keyed to the text of the error it fixed, so it could fire again only when the same message came back. A builder that rewrites a file wholesale on every pass does not get the same message back; it gets new ones, about new inventions. The thing it was actually repeating, the improvement itself, was never a candidate for a lesson, because each of the five attempts committed, and a commit was the builder’s definition of success. It had been given a memory for its errors on the afternoon it most needed one for its successes.
The cap of a hundred never bound. Nine was all it ever learned, and it printed the count at every start.