Tool Library: Each Owner Converts Its Own What has to be written Release three records each tool's condition. That is a new saved fact, in Shelf. Shelf's version one file is locked, so we do not touch it. We write version two beside it: the same two counts, plus condition. And version two says how to get there from version one. Every existing tool becomes good. Remember that a parent names the exact version of its children. Branches holds Shelf version one, by name. To hold version two, Branches needs a version two of its own. And the root holds Branches, so the root needs one as well. The change travels up the owning path to the root. It does not travel sideways. Members, Loans and Policy stay on version one. One line completes it. The root names the version it is willing to start from. Now this build carries two seals: the one it wants to end on, and the one it accepts as its predecessor. Without this line, the gate would turn it away, exactly as in the last lesson. The conversion, owner by owner The upgrade starts. The gate sees the predecessor seal and admits the build. Now the root converts. It has no data of its own to change, only children to place. Policy, Members and Loans are unchanged, so the root moves each one across as it is. Their vaults are never opened. Branches is different. The root cannot convert it. It hands Branches to Branches' own converter. Branches does the same thing one level down. For each key, it takes the shelf, hands it to Shelf's converter, and attaches the result on the same key. Only Shelf opens a shelf. It rewrites each tool with the new field. Four, one becomes four, one, good. Branch five is empty, and converts to empty. All of that was one upgrade. No call runs in the middle. Then the services are bound, and only then does the canister remember the new seal. There is no second step and no background job, so the whole conversion has to fit in one upgrade. This is where the limits from lesson one pay off. Thirty-two branches of five hundred tools is a number you can test. Two release rules Run that again, with a build that goes wrong. Back on release two. The conversion completes, the new column is there, and then startup fails. The Internet Computer restores the old program and its memory together. Release two is running again with five loans and its original contract. Now release three is in, and a week of conditions has been recorded. Someone wants release two back. The canister holds version two memory and release two expects version one. The gate refuses. Release three keeps running. To bring the old lending rules back, ship a new build that keeps version two memory and the recorded conditions. Plan that recovery path before the migration.