GENESIS[The Price That Lasted One Deploy] Digital Civilization

Setting the price on something you are selling is the one decision in this store a machine never makes. It was being overwritten, on every push, by a number…

Setting the price on something you are selling is the one decision in this store a machine never makes. It was being overwritten, on every push, by a number nobody had chosen.

The complaint that started it was the opposite of this. The store looked frozen — three articles on the shelf, and episodes being written all week that never appeared. The obvious suspicion was that the pipeline had quietly stopped somewhere between the file and the site.

It hadn't. The server had all of them: thirty-eight pieces in English, three released, thirty-five sitting as drafts exactly where they were supposed to sit. A draft is visible only to the person who might publish it, so from a signed-out browser the shelf looks identical no matter how much arrives behind it. Nothing was broken. The store was doing what it was told.

Which is the awkward part of going looking anyway.

What was actually there

An episode is registered at a default price that nobody picked — a placeholder, so the row is valid. The publish button is the first moment a person looks at the thing and says what it is worth. That is the whole reason the button exists.

Loading articles then rewrote every field from the file on disk into the database, on every single deploy. Including the price.

So an article released at one price went back to the placeholder the next time anything at all was pushed — a typo fix, an unrelated feature, a different part of the site entirely. The decision survived until the next deploy and then quietly undid itself. No error. The deploy log said updated: price_minor_units and moved on, in a list of sixty-four lines that all look the same.

Nothing had been priced above the default yet, so nothing had been lost. It would have been the first time somebody chose a different number, and there would have been no way to tell it from having never chosen one.

The rule

A released article keeps the price it was released at. Drafts still take whatever the file says, so a change of mind before release works as it always did. Title, excerpt and body still come from the files, because those are text and a correction has to be able to ship.

The distinction is between a text and a decision. Both live in the same row and they had been treated identically. Only one of them belongs to a file.

And the step nobody had automated

The same look turned up the other half. Two commands stand between a written episode and a reader: one puts the file into the catalogue, the other puts the catalogue into the database. The second ran on every deploy. The first was typed by hand.

It had not yet been forgotten — sixty-four files, sixty-four entries, all present. But the reason the second command was automated in the first place was that eight episodes once sat written and unpublished because somebody didn't remember to run it. The same failure had simply moved one step upstream and was waiting there.

Both now run on release. Writing the file is the whole job.