◉ANTIGRAVITY LABJP
Articles/App Development
▣ App Development/2026-07-14Advanced

When the Deploy Was Green but Users Still Saw the Old Build: Field Notes on a Gate That Verifies Your Shipped Commit Reached the Edge

When a deploy reports success but production keeps serving the old build, a post-deploy gate that verifies your shipped commit actually reached the edge via a build stamp closes the gap. Field notes with real operational numbers.

Antigravity426DeploymentCI/CD17ObservabilityOperations14

✦ Premium Article

Support kept coming in about a bug I was sure I'd fixed. CI was green. The deploy screen said "success." The commit was on main. Yet opening production, the behavior I'd fixed was still there, unchanged.

The cause was almost anticlimactic. The build had run, but the edge cache kept serving the previous bundle. That green checkmark meant only "the pipeline ran to the end" — not "users are seeing the new code."

Those two are alike in appearance and completely different as facts. This note — using an app I run as an indie developer — records how to build a post-deploy gate that verifies your shipped commit actually reached the edge, via a stamp baked into the build, along with the numbers from running it. I landed on this shape only after shipping two quiet incidents to this exact mix-up.

Why you can't trust "deploy succeeded"

A green deploy guarantees only one of several independent stages: that CI finished without an exception. Between there and the new code reaching a user's screen, several traps remain.

The edge or CDN cache keeps serving the old bundle. The atomic swap lags, so some regions stay on the previous version. Or you shipped not to the intended production project but to a preview environment or a different branch. From CI's vantage, all of these are "success"; from the user's, nothing changed.

The scary part in production is that this kind of mismatch never surfaces as an error. No 500, nothing in the logs — just old behavior served quietly. That's exactly why, instead of believing it succeeded, you need a step that goes and checks whether it actually arrived.

Bake a verifiable stamp into the build

First, make it mechanically readable from production which commit's build is currently live. Embed the commit SHA into the artifact at build time and serve it from a fixed location like /version.json.

// What this does:
// At build time, write out the commit SHA and build time as version.json
// so it can be served as a production static asset.
// scripts/stamp-version.mjs
import { execSync } from "node:child_process";
import { writeFileSync, mkdirSync } from "node:fs";
 
const sha = execSync("git rev-parse --short HEAD").toString().trim();
const builtAt = new Date().toISOString();
 
mkdirSync("public", { recursive: true });
writeFileSync(
  "public/version.json",
  JSON.stringify({ sha, builtAt }, null, 2)
);
 
console.log(`stamped version.json: ${sha} @ ${builtAt}`);

Run this just before your build script, wired as "build": "node scripts/stamp-version.mjs && next build". Now hitting https://your-app.example/version.json tells you at a glance which commit the edge is currently serving. The stamp need not be a SHA — a monotonically increasing build number works too. What matters is being able to reconcile the value the shipping side expects against the value production returns.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Why a green deploy doesn't mean production reflects your change, and a post-deploy gate that verifies the commit at the edge
✦Code that stamps the commit into the build and fetches the live marker while bypassing caches
✦Measured reduction in stale-build incidents reaching users after adding the gate
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

▣ App Dev2026-11-24
Two Times Inlining CSS Made FCP Slower, and How I Now Decide Per Site Whether to Inline
I inlined CSS into the HTML to clear PageSpeed Insights' render-blocking warning, and FCP got almost a second slower. The font preload had been pushed down to byte 28,672 of the head. Even after fixing the placement, the same change made a second site with 88KB of CSS slower, and I rolled it back. Here is a script that counts byte offsets inside the head, an inliner with a size cap, and the pattern I use on the larger site instead.
▣ App Dev2026-11-23
From December 1, Someone Else Answers gemini-2.5-flash: Find Every Place You Hard-Coded the Name First
On December 1 the Gemini API starts routing gemini-2.5-pro to gemini-3.8-flash and gemini-2.5-flash to gemini-3.5-flash-lite, billed at the new models' rates. Nothing errors, so it is easy to miss. Here is a script that finds model names across code, config and MCP settings, plus a way to log modelVersion so you can see the switch yourself.
▣ App Dev2026-11-12
Check Web Font Delivery with an Origin Header, Too: How a Fallback Font Went Unnoticed on My Site for 13 Days
For 13 days, the Latin web font on my own site kept returning 404 and every page was drawn in a fallback face. A plain curl returned 200; only the browser's request, which carries an Origin header, received the stale 404. Here is a script that compares three kinds of request, a setting that keeps long cache lifetimes off error responses, and how to pick a purge that reaches every variant.