AMODX Sprint 6 - Testing And Optimizations

by Andrei Roman

Sprint 5 shipped a physical goods commerce engine. Sprint 6 shipped almost no features.

It shipped the truth instead.

The cache that never was

AMODX has a two-layer cache. CloudFront at the edge. An S3 page cache behind it. Documented in detail. Marked COMPLETE in the security remediation log.

It had never served a single page.

One line of code — a cookie read in the wrong place — pushed every route into dynamic rendering. Every visitor, every page view, every tenant: full React render, full DynamoDB reads. The architecture was real. The switch was off. Nobody knew, because the site still worked.

"Don't touch it, it works" is the most expensive sentence in software. I wrote an essay about that once. This sprint I got to eat it.

What turning it on revealed

You can't just flip a broken switch. Turning the cache on exposed five more lies, each invisible while nothing was cached:

- A single request with one header could replace a page at the edge for every visitor. Cache poisoning, one curl away.

- Logged-in customers on access-gated pages would have been served the anonymous cached copy.

- The "refresh this page" call after an admin edit had never worked in any deployed environment. Two separate bugs, stacked. Best-effort error handling swallowed both for months.

- The image optimizer returned 500 for every optimized image on every tenant. Since launch. Nobody noticed because most images take another path.

- Published articles never appeared in listing pages until a nightly cache wipe. The background refresh was dead — CloudFront silently ate the header that triggers it.

That last failure mode showed up four separate times: CloudFront stripping a header something depended on. Same disease, four organs.

Every one of these passed its original code review. Every one shipped green.

How we found them

Not by reading code. By making the system unable to lie.

Every claim became a probe. "The cache works" became: curl it twice, show me Hit from cloudfront, show me zero database reads. "Purges work" became: purge, then show me the S3 object change. A claim without a transcript stopped counting.

The build process enforced it. Every change went through an adversarial review loop — one AI builds, another AI attacks the diff, and the fights escalate to me only when they matter. The cache track alone produced six escalations. All six were real defects, caught before production. One was a design of mine, refuted by measurement before a line shipped.

The reviewer also caught the builder claiming a test transcript that didn't exist. Machines lie like juniors under deadline. Verification doesn't care who wrote the code.

What tenants actually got

- Pages served from the edge. Cached, fast, cheap. For real this time — verified on live domains.

- Instant publish. Edit a page, it's live in seconds. The 15-minute "go live" timer is gone for normal edits.

- Reviews with photos. Import your Google reviews in bulk — text and images — moderate each photo individually, publish. Every image passes through quarantine before it can touch the public CDN, and every import carries a signed rights attestation. Your lawyers will never need it. That's the point.

- Half the JavaScript. Heavy libraries now load only on pages that use them.

- A DNS health checker. Pick your mail provider, see the exact records to publish, see whether you actually did.

And a month of production bugs died: the product page 500s, the review query that had silently returned nothing since the feature shipped — DynamoDB rejects the word source, and a catch block ate the rejection for months.

The wall at 501

Mid-sprint, deploys stopped. CloudFormation caps a stack at 500 resources. We were at 501.

The obvious fix — move resources to a nested stack — failed in staging: API routes collide when moved between stacks. The fix that worked: move the functions, leave the routes. Zero downtime. The staging rehearsal caught what would have been a production outage. Twice.

Safety-critical software taught me this: the rehearsal is not overhead. The rehearsal is the product.

The sticky note

Features tell you what a system does, on the surface. Probes tell you what it actually does, deep down. The gap between the two is where your business quietly bleeds.

Sprint 6 closed the gap. AMODX now has five layers of tests where it had one commented-out file reporting PASS — including an end-to-end suite that logs into the deployed system, imports real reviews against real AWS, verifies tenant isolation on private images, and deletes its own tracks.

The commerce vault — moving every tenant's order data behind a wall the public renderer physically cannot reach — is next. Now it lands on a foundation that can't lie about being ready.

---

Discussion (0)

No comments yet. Be the first!

Join the conversation