fix(deploy/site): stop 08 failing the cutover over two miscalibrated checks

Both fired on a healthy production cutover and told the operator to roll
back, which is worse than not checking at all.

- The DNS check looked for a CNAME on www. Once the custom domain is
  attached the record is PROXIED, so it answers with Cloudflare anycast A
  records and exposes no CNAME — the empty result was the correct state
  being reported as "unexpected target". Now it asserts what actually
  matters: the host resolves, and it does not still CNAME to Vercel. The
  authoritative on-Cloudflare signal was already the cf-ray/x-vercel-id
  pair right below it.

- HSTS absence was a hard FAIL. It is an independent one-toggle choice with
  no bearing on whether the migration worked, so it is a WARN unless
  EXPECT_HSTS=1. Set that once the zone toggle is on and it becomes a hard
  assertion again.

Verified against the real cutover: 21 probes, 20 pass, 1 warn (HSTS), 0 fail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LAmkjM7okPdScp9XLW1JVr
This commit is contained in:
Viktor Vaczi 2026-07-27 14:50:34 +02:00
commit c61ec8aa0c
2 changed files with 24 additions and 9 deletions

View file

@ -241,11 +241,19 @@ assert_parity() {
# 6) prod-only
if [ "$_scope" = prod ]; then
# HSTS is a deliberate, independent choice — one zone toggle, unrelated to
# whether the migration worked. Absent is a WARN, not a FAIL: failing here
# would tell an operator to roll back a healthy cutover. Set EXPECT_HSTS=1
# once you have enabled it, and it becomes a hard assertion.
_hsts="$(_hdr "$(_headers "$_base/")" strict-transport-security)"
case "$_hsts" in
*max-age=63072000*) pass hsts - "$_hsts" ;;
"") fail hsts - "absent (Vercel sent max-age=63072000)" ;;
*) soft hsts - "$_hsts (differs from the Vercel baseline)" ;;
"") if [ "${EXPECT_HSTS:-0}" = 1 ]; then
fail hsts - "absent, but EXPECT_HSTS=1"
else
soft hsts - "absent (Vercel sent max-age=63072000) — enable it in SSL/TLS -> Edge Certificates, then set EXPECT_HSTS=1"
fi ;;
*) soft hsts - "$_hsts (differs from the Vercel baseline max-age=63072000)" ;;
esac
fi