mirror rev 4: evidence-verified rewrite, six-diagram artefact set, front-end and build-gate hardening

Content corrected against upstream docs, deployed-version source and the live
config: retention/GC semantics (untagged manifests including digest-only
pull-through entries are GC-eligible; keepUntagged is v2.1.19+, not deployed),
warm-cache guarantees (tag pulls revalidate upstream per open issue; digest
pulls serve locally), retry arithmetic (buildah --retry counts retries: 16 max,
not 12), five-upstream flat-namespace routing stated as observed risk with a
proposed prefix redesign, auth-canary design validated against longest-match
policy precedence with the Docker-client caveat, coalescing reframed from
deadlock to design with the restart as recovery-not-root-cause. Adds fact
panel, contents, failure-mode and cache test matrices, decision table, open
verification register and primary-source references. Front-end: grid full-bleed
(no viewport units - no scrollbar overflow), shell-level skip link, real
1600x872 intrinsic dims injected from bytes, lazy below-fold plates, AA
code-comment contrast, scene engine rewritten (IO-gated, rAF-coalesced, live
reduced-motion, hidden-tab pause, zero guards). Assembler: per-page gates plus
mirror-specific required/banned content assertions. README describes the
multi-page site honestly.
This commit is contained in:
2026-08-25 08:08:18 +10:00
parent 08e80d9f9f
commit 7f7035b98f
5 changed files with 912 additions and 435 deletions
+56 -2
View File
@@ -40,6 +40,30 @@ function webpSize(buf) {
return null;
}
// --- intrinsic JPEG dimensions (SOF0/SOF2 markers) for the mirror plates ---
function jpegSize(buf) {
if (buf[0] !== 0xff || buf[1] !== 0xd8) return null;
let o = 2;
while (o + 9 < buf.length) {
if (buf[o] !== 0xff) { o++; continue; }
const marker = buf[o + 1];
if (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {
return { h: buf.readUInt16BE(o + 5), w: buf.readUInt16BE(o + 7) };
}
o += 2 + buf.readUInt16BE(o + 2);
}
return null;
}
// skip link: emitted by the shared shell, so its accessibility CSS lives in the shell
// too - visually hidden until keyboard focus, visible and prominent when focused.
const SKIP_CSS = `<style>
a.skip{position:absolute;left:-9999px;top:0;z-index:99}
a.skip:focus{left:1rem;top:1rem;background:#070b14;color:#3fbaf5;
font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8rem;
padding:10px 16px;border:1px solid #3fbaf5;border-radius:6px;outline:none}
</style>`;
let tpl = readFileSync(join(ROOT, "pilot/arc.tpl.html"), "utf8");
// split the app script (the last <script> block) out of the template
@@ -136,6 +160,7 @@ const shell = ({ title, desc, path, ogImg, scripts, bodyHtml }) => `<!doctype ht
<meta name="twitter:description" content="${desc}">
<meta name="twitter:image" content="${ogImg}">
<link rel="icon" href="${favicon}">
${SKIP_CSS}
</head>
<body>
<a class="skip" href="#main-content">Skip to content</a>
@@ -157,9 +182,14 @@ const MIRROR_DESC = "A pull-through container registry taken apart: why a lab ru
let mirror = readFileSync(join(ROOT, "pilot/mirror.tpl.html"), "utf8");
const mirrorPlates = {};
for (const n of ["20", "21", "22", "23", "24", "25"]) {
const { url } = emit(join(ROOT, "assets/mirror", `${n}.jpg`), `mirror-${n}`, "jpg");
const { url, buf } = emit(join(ROOT, "assets/mirror", `${n}.jpg`), `mirror-${n}`, "jpg");
mirrorPlates[n] = url;
mirror = mirror.replace(`__M${n}__`, url);
const dims = jpegSize(buf);
if (!dims) throw new Error(`mirror plate ${n}: JPEG dimensions unreadable`);
// plate 20 is the page's first image (near the fold) -> eager/LCP; the rest lazy.
const load = n === "20" ? "eager" : "lazy";
mirror = mirror.replace(`__M${n}__`,
`${url}" width="${dims.w}" height="${dims.h}" decoding="async" loading="${load}`);
}
const mirrorJs = readFileSync(join(ROOT, "pilot/mirror.js"));
const mirrorJsName = `mirror.${fp(mirrorJs)}.js`;
@@ -206,6 +236,30 @@ for (const [pg, doc] of [["cluster", html], ["mirror", mirrorHtml], ["index", di
if (m[1] && !pidset.has(m[1])) fail.push(`${pg}: dangling internal link #` + m[1]);
}
}
// mirror-page content gates: retired claims may be DISCUSSED as corrections, so these
// target the assertive phrasings and internal production jargon, not the topic words.
const mirrorBanned = [
[/never leaves the building/i, "retired absolute cache claim"],
[/up to twelve|twelve tries|12 attempts/i, "stale retry arithmetic (correct figure: sixteen)"],
[/plate-level/i, "internal production note leaked to readers"],
[/&middot; motion:/i, "art-direction caption leaked to readers"],
[/Phase B/, "internal phase jargon without explanation"],
[/RAID .*(is|are) (a )?backup/i, "snapshots/RAID-as-backup claim"],
];
for (const [re, msg] of mirrorBanned) if (re.test(mirrorHtml)) fail.push("mirror: " + msg);
const mirrorRequired = [
["zotregistry.dev", "primary zot references missing"],
["keepUntagged", "version-gated retention discussion missing"],
["/livez", "real health endpoints missing"],
['id="refs"', "references section missing"],
['id="open"', "open-verification register missing"],
['width="1600" height="872"', "plate intrinsic dimensions missing/incorrect"],
];
for (const [needle, msg] of mirrorRequired) if (!mirrorHtml.includes(needle)) fail.push("mirror: " + msg);
must((mirrorHtml.match(/width="1600" height="872"/g) || []).length === 6, "mirror: expected six correctly-dimensioned plates");
must(!/100vw/.test(mirrorHtml), "mirror: viewport-width unit reintroduces scrollbar overflow");
must(!mirrorHtml.includes("gsap"), "mirror: unexpected animation library reference");
// banned / obsolete strings (user-visible copy)
const banned = [
[/ArgoCD/, "user-visible 'ArgoCD' (use 'Argo CD')"],