fix(e2e): hard + body-validate the hub /healthz probe (BUNYIP-185) #204
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-185-hub-healthz-hard-probe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Tightens the hub
/healthzreachability probe from soft to hard + body-validating, now that staging serves the real endpoint (BUNYIP-185, follow-up to BUNYIP-149).Why / what changed beyond a plain flip
Verifying the deploy surfaced two things a plain
soft->hardflip would miss:.fallback(public::not_found)) that returns HTTP 200 + HTML for any unknown path. So a 200 alone never proves/healthzis real - the fallback would satisfy a status-only probe forever. The hub probe now requires the JSON body{"status":"ok"}.psa.systemsstill serves the fallback (prod deploys on releases, not every merge), and the hub probe runs against prod on a production dispatch. So it's hard + body-validating everywhere except the prod apex, which stays soft untilpsa.systemsserves/healthz. This keeps the merge-gating PR path (staging) strictly enforced without breaking prod dispatches.The API
/healthprobe is split into its own status-only hardprobe()(nosoftparam, per the issue AC); the hub usesprobeHub().Verified
curl https://a8n.systems/healthz->200 application/json {"status":"ok"}(real endpoint).curl https://psa.systems/healthz->200 text/html(still the fallback -> the carve-out).node --checkclean.Follow-up
Remove the
PROD_APEX_HOSTcarve-out + thesoftbranch inprobeHuboncepsa.systemsserves/healthz(next prod release).🤖 Generated with Claude Code
BUNYIP-149 made the hub /healthz probe SOFT to avoid deadlocking the PR that introduced the endpoint (staging did not serve it yet). Staging now serves the real endpoint (a8n.systems/healthz -> 200 application/json {"status":"ok"}), so tighten it. Two changes beyond a plain soft->hard flip, both discovered when verifying the deploy: 1. Body validation. bunyip-web has a soft-404 fallback (`.fallback(public::not_found)`) that returns HTTP 200 + HTML for ANY unknown path. So a 200 alone does NOT prove /healthz is the real endpoint - the fallback would satisfy a status-only probe forever. The hub probe now requires the JSON liveness body `{"status":"ok"}`; a 200-HTML fallback fails it. 2. Production-apex carve-out. psa.systems still serves the fallback (prod deploys on releases, not every merge), and the hub probe runs against prod on a production dispatch. So the hub probe is hard + body-validating everywhere EXCEPT the prod apex, which stays soft (warns, continues) until psa.systems serves /healthz. This keeps the merge-gating PR path (staging) strictly enforced without breaking prod dispatches. Remove the PROD_APEX_HOST carve-out + the `soft` branch in probeHub once prod is deployed. The API /health probe is split into its own status-only hard `probe()` (no `soft` param, per the issue AC); the hub uses `probeHub()`. node --check clean. #BUNYIP-185 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>