A version number is pushed once, and every build addresses its CSS differently
gates / gates (push) Failing after 44s
gates / gates (push) Failing after 44s
MEASURED FIRST (audits/app-page-2026-10-15b/P0/VERDICT.md). The tab bar rendered unstyled through
the public address for one reason, and it was not the box: exactly one guest runs 0.315.0 and it
runs the registry's current digest (8887343011d6, identical to the registry's). The floor is still
0.314.0, so nothing else could have taken it.
What it was, in four measured facts:
1. the stylesheet URL is /static/style.css?v={{.Version}} -> ?v=0.315.0 for all THREE different
0.315.0 builds (e66d466, fe0228c, db52f5a), the first of which had no .app-tabs rules at all;
2. the origin sends NO validator at all (ETag present = 0, Last-Modified present = 0), so a
cached copy cannot be revalidated - it can only expire;
3. Cloudflare caches that URL (cf-cache-status HIT, age climbing) and rewrites the browser TTL
from the origin's 3600 to 14400 - four hours;
4. the session's first request returned cf-cache-status EXPIRED, which only happens when the edge
holds an entry that has aged out.
Origin, edge and box now agree byte-for-byte. The stale object itself is gone - that first probe
forced its revalidation - and the REPORT says so rather than claiming a HIT nobody can reproduce.
THE FIX IS IN TWO PARTS, NEITHER OF WHICH IS PURGING A CACHE:
build.sh refuses to push a version that already exists, before building, for --push and
--multiarch. A registry that cannot be asked is a refusal too: proving the tag is new is the point,
and "I could not ask" is not that proof. Local builds are untouched - reusing a version while
iterating is normal. scripts/test_build_push_once.sh drives the real build.sh with a fake docker on
PATH over six cases; red-proved twice (check deleted -> a present tag builds and pushes; an
unreachable registry treated as absent -> two cases fail).
assetTag() now hashes version + GitCommit + BuildTime, and EVERY shell's stylesheet link uses it
(seven of the nine asked for ?v={{.Version}}; only the two stranger-facing share pages already had
it). It stays opaque and 8 hex, because the share pages are reached by a capability URL and naming
the build to whoever holds one is a gift to somebody hunting a known fault. Cache-Control is
unchanged: the new address is the fix, not a shorter cache.
The parity harness normalises the asset tag on BOTH sides of the comparison, as it already does for
the per-session CSRF token, so all 148 fixtures stay byte-identical on disk and stop depending on
which build rendered them. The same normalisation is applied at the second comparison site in
i18n_wiring_test.go, which had the same assumption.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117kRTSgs3rJWUFGxyoWN6Y
This commit is contained in:
@@ -66,6 +66,47 @@ info "Build dir: ${BUILD_DIR}"
|
||||
info "Image: ${IMAGE}:${VERSION}"
|
||||
echo ""
|
||||
|
||||
# =========================================================================
|
||||
# A VERSION NUMBER IS PUSHED ONCE (v0.316.0)
|
||||
# =========================================================================
|
||||
# 0.315.0 was built and pushed THREE times from three different commits. A box that pulled between
|
||||
# the first and the last runs different code under the same number — and will never fetch the fix,
|
||||
# because to the box, and to the floor, that number is already current (`09-update-architecture.md`:
|
||||
# a box compares VERSIONS, and re-pulls a tag it already has only when the tag changes). Nothing in
|
||||
# the build stopped it. This does.
|
||||
#
|
||||
# The check runs BEFORE the build, so a refusal costs no minutes. A registry that cannot be reached
|
||||
# is a REFUSAL too: the point is to prove the tag is new, and "I could not ask" is not that proof.
|
||||
# Local builds (no --push) are unaffected — reusing a version while iterating is the normal case.
|
||||
#
|
||||
# `docker manifest inspect` is the probe, so a test can put a fake `docker` on PATH
|
||||
# (scripts/test_build_push_once.sh).
|
||||
if [[ "${ACTION}" == "--push" || "${ACTION}" == "--multiarch" ]]; then
|
||||
step "0/4 — Checking the registry: is ${VERSION} already published?"
|
||||
# `set -e` is on, and a failing command substitution would abort the script before the rc is
|
||||
# ever read — which would turn "the registry said no such tag" into a silent exit. The `|| true`
|
||||
# keeps the failure for us to classify; that classification is the whole check.
|
||||
probe_rc=0
|
||||
probe_out=$(docker manifest inspect "${IMAGE}:${VERSION}" 2>&1) || probe_rc=$?
|
||||
if [[ ${probe_rc} -eq 0 ]]; then
|
||||
error "${IMAGE}:${VERSION} already exists in the registry — bump the version."
|
||||
error "A version number is pushed once. Two images under one number mean a box can run"
|
||||
error "either of them and never learn the difference. If this is a fix for something already"
|
||||
error "pushed, release it as the next patch version instead."
|
||||
exit 1
|
||||
fi
|
||||
# Absent is the ONLY other acceptable answer. Anything that is not a clean "not found" (the
|
||||
# registry is down, the login expired, DNS failed) leaves the question unanswered, and an
|
||||
# unanswered question is a refusal.
|
||||
if ! grep -qiE 'no such manifest|manifest unknown|not found|does not exist|NAME_UNKNOWN|MANIFEST_UNKNOWN' <<<"${probe_out}"; then
|
||||
error "Could not establish whether ${IMAGE}:${VERSION} exists — refusing to build."
|
||||
error "The registry answered: ${probe_out}"
|
||||
error "Proving the tag is new is the point of this check; 'I could not ask' is not that proof."
|
||||
exit 1
|
||||
fi
|
||||
info "${VERSION} is not present in the registry — proceeding."
|
||||
fi
|
||||
|
||||
# =========================================================================
|
||||
# Step 1: Prepare clean build workspace
|
||||
# =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user