Interactive demo · synthetic dataEvery record on this page is fabricated.

Product Page Automation

The three decisions that make a product page a deterministic function of the workbooks, rebuilt from the specification.

The production system behind this demo was engineered by Luthfi Aditya — LinkedIn profile, opens in a new tab. I managed and directed it — requirements, technical review, QA and rollout.

Read about the system

PROVENANCE — NOT A PORTThe production tool is not in this repository, so the three decisions below were rebuilt from the project’s specification rather than ported from its code. The engineer credited above built that production system; what runs on this page is a reconstruction of the rules implemented there, and it is tested against the specification rather than against the original.

DECISION 1Which variants exist

One skeleton, five production types. They differ only in flags, stock location and size filtering — which is why this is a rule table and not five code paths that drift apart. Change the type and watch the variant set recompute.

The type names are reconstructed; the four behaviour columns are the specified part.

The five production types and the flags, location and size rule each one sets
TYPETAGPOLICYLOCATIONSIZE RULE
to-produceCONTINUETO_PRODUCEfull-template
in-productionCONTINUETO_PRODUCEfull-template
in-stockDENYMAIN + OUTLETstocked-only
restockDENYMAIN + OUTLETstocked-only
sampleDENYSAMPLE_ROOMsample-run

Only sizes with stock at either warehouse become variants, and real per-warehouse quantities are written.

VARIANT SET FOR MRD-2207 / DEEP TEAL · 4 VARIANTS · 129.00 EACH

The variants this production type would create
SIZESKUBARCODEGRAMSQTY → LOCATION
XSMRD2207-DTL-XS200022070001838012 → MAIN
MMRD2207-DTL-M200022070003242040 → MAIN
LMRD2207-DTL-L20002207000494457 → MAIN
XLMRD2207-DTL-XL20002207000564703 → MAIN
  • S excluded — no stock at either warehouse

DECISION 2Where the quantity lands

The mutation is sent, and the storefront hands back its variants in its own order — and here it did not hand back size M at all. The tool now has to put each quantity on the right variant.

The rule the system runs on: every quantity is looked up by SKU, so the storefront's ordering cannot matter.

THE TOOL INTENDED

  1. 0MRD2207-DTL-XS12
  2. 1MRD2207-DTL-M40
  3. 2MRD2207-DTL-L7
  4. 3MRD2207-DTL-XL3

THE STOREFRONT RETURNED

  1. 0MRD2207-DTL-LL
  2. 1MRD2207-DTL-XLXL
  3. 2MRD2207-DTL-XSXS

WHAT WAS WRITTEN

  1. SIZE XS12 units — intended for size XS (MRD2207-DTL-XS)correct
  2. SIZE L7 units — intended for size L (MRD2207-DTL-L)correct
  3. SIZE XL3 units — intended for size XL (MRD2207-DTL-XL)correct

SKIPPED WITH A NOTE · storefront returned no variant for MRD2207-DTL-M — 40 units not written, logged and skipped

Every quantity landed on its own size. A variant the storefront did not return is skipped with a note rather than having its quantity handed to whichever variant happened to be next.

DECISION 3Create, update, or leave alone

A lookup sheet is consulted before anything is written. No row means create, as a draft. A row hands back the product id. A row the snapshot calls live is skipped rather than quietly rewritten — which matters a great deal, given what an update re-sends.

SNAPSHOT AGE · 47 MIN

What the run decides for each style-colour in the batch
STYLE-COLOURSNAPSHOTACTUALLYDECISION
MRD-2207 / DEEP TEAL— absent —— none —CREATEnot in the lookup snapshot — create as a draft
MRD-2207 / BONEDRAFTDRAFTUPDATEsnapshot says draft — update the existing page
MRD-3110 / SLATEACTIVEACTIVESKIP ALREADY LIVEsnapshot says the page is live — skipped, not rewritten
MRD-3110 / EMBERDRAFTACTIVEUPDATEsnapshot says draft — but the page went live after the snapshot was taken
MRD-4025 / MOSSACTIVEACTIVESKIP ALREADY LIVEsnapshot says the page is live — skipped, not rewritten

In the specification this page rebuilds, the lookup is a snapshot refreshed by its own hourly job. MRD-3110 / EMBER went live 47 minutes ago and the snapshot still says draft, so the run would rewrite a page customers are currently looking at. That window was up to an hour wide, and it is written into the caveat register rather than left to be discovered. Since September 2026 production also updates the lookup per product by webhook within seconds, with a full snapshot each night catching any delivery that is missed.

THE SHARP EDGEAn update re-sends the whole page

A page is a deterministic function of the sheets. That is the point of the tool and it is also its cost: an update re-sends handle, SEO, description, tags and images, so a correction made anywhere other than the sheet does not survive the next run. Six hand edits are sitting in the storefront admin below.

Fields edited by hand in the admin, beside the value the tool sends
FIELDIN THE ADMIN NOWWHAT THE RUN SENDS
handledeep-teal-merino-crew-neckmrd-2207-deep-teal
SEO titleDeep Teal Merino Crew — free shipping over 500MRD-2207 Deep Teal | MERIDIAN
SEO descriptionHand-written by merchandising after the January search review.Deep Teal. Merino crew neck. Sizes XS–XL.
description…plus a care paragraph a customer-service lead added in March.Per-style description, rebuilt from the master data sheet.
tagsin-stock, staff-pick, gift-guidein-stock
imagesflat-lay first (reordered by hand)sheet order — on-figure first

6 of 6 fields would be replaced by this run. Press it and watch a merchandiser’s afternoon disappear.

THE REGISTERKnown caveats, written down

The production README carries a register of sixteen known caveats. Requiring it be written down rather than remembered was a decision, and it is the most useful artefact the project has.

That file is not in this repository, so this is not a transcript of it. These 14 are the register this rebuild can stand behind — 9 of them demonstrated on this page, the rest following from the specification it was written from or, for the nightly snapshot, from the production repository’s own deploy files. Claiming sixteen and showing an approximation would be the exact failure the register exists to prevent.

  1. 01An update re-sends handle, SEO title, SEO description, description, tags and images. A hand edit made in the storefront admin is overwritten on the next run.SHOWN HERE
  2. 02The create-or-update lookup is a snapshot. A page can go draft → active between refreshes, and the run will not know.SHOWN HERE
  3. 03Inventory is matched to a variant by SKU. Position-matching a quantity list against the order the storefront returned once put quantity on the wrong size.SHOWN HERE
  4. 04A variant the storefront does not return is skipped with a note. The quantity is not written, and the run says so.SHOWN HERE
  5. 05A style with zero stock at every warehouse is skipped with a message, not created as an empty page.SHOWN HERE
  6. 06Under the placeholder types every quantity is identical, so a mis-assignment is indistinguishable from a correct one until real quantities differ.SHOWN HERE
  7. 07Creation always writes a draft. Nothing in the tool publishes a page.SHOWN HERE
  8. 08A size with no row in the UPC list gets no variant, because a variant with no SKU cannot be matched on the next run.SHOWN HERE
  9. 09A page the snapshot calls live is skipped rather than rewritten — which also means a genuine correction to a live page cannot be pushed by this tool.SHOWN HERE
  10. 10The six upstream sources are read once and cached for the life of the run, so a sheet edited mid-run is not picked up.STATED ONLY
  11. 11Images are attached by their existing storefront file identifier, so a file that has been deleted or replaced upstream will not re-upload itself.STATED ONLY
  12. 12The resume ledger must live on a mounted volume. On a container's ephemeral filesystem the resume state dies with the container.STATED ONLY
  13. 13The full snapshot runs once a night, not when the container starts, so a webhook delivery Shopify has given up on stays missing from the lookup until the next nightly run.STATED ONLY
  14. 14A Sheets values:append that returns 5xx after the server applied it cannot be blind-retried — there is no idempotency token, and a retry duplicates the row.STATED ONLY

WHY THIS ONE IS A REBUILD

Most demos on this site run production logic, copied or ported by hand out of the systems they came from. This one cannot: the production tool is thirty-three Python files that read six workbooks and sheets, and it is not in this repository — only a fix/ fragment holding a checkpoint ledger and a retry wrapper, neither of which contains any of the logic above.

So the three decisions were rebuilt from the project’s own specification. There is no original to diff against and no digest to pin against it. That is a weaker claim than a ported demo makes, and it belongs on the page rather than in a footnote — /demos labels this one REBUILT FROM SPECIFICATION for the same reason.

THE STYLE ON THIS PAGE

style
MRD-2207
colourway
DEEP TEAL
label
MERIDIAN — fictional
price
129.00

Every code, weight, barcode and quantity is invented. The barcodes sit in the GS1 200-prefix range, which is reserved for internal use and cannot collide with a real product.

What is real, and what is simulated

Runs in your browser

  • The five-production-type rule table, and the variant set it recomputes — size filtering, stock location, inventory policy and tag
  • Both inventory matchers, SKU-keyed and positional, run side by side over the same storefront response
  • The skipped-with-a-note behaviour when the storefront returns no variant for a SKU
  • The create / update / skip-already-live decision, and the stale-snapshot drift window

REBUILT FROM SPECIFICATION, not ported. The production tool is thirty-three Python files and is not in this repository — only a fix/ fragment, which contains none of this logic. So there is no original to diff against and no digest to pin: 33 tests assert that this rebuild does what the project specification says, which is a weaker claim than a ported demo makes and is stated here rather than left to be assumed.

Simulated

  • The Shopify Admin productSet mutation and the REST inventory and metafield calls — nothing is sent anywhere
  • All six upstream sheet and workbook sources, the jobs that keep the lookup current, the Streamlit interface and the scheduling
  • The order the storefront returns variants in, and the variant it omits — fixed here so the failure is reproducible
  • The style, colourway, SKUs, barcodes, weights, prices and quantities — all invented for MERIDIAN, a fictional label