Cycle 13, batch 3: real 404 page and build tag, permanent URLs (retire /prototype/) #55

Merged
brandon merged 2 commits from cycle13-batch3 into main 2026-11-10 07:24:47 +00:00
Collaborator

Two stories, one commit each: 24.6 and 24.7.
▎
▎ - 24.6: A missing URL now shows the site's own 404 page instead of the homepage with a 200. nginx redirects are relative, so they stay on https behind Coolify's TLS proxy (one hop, not a detour through http). Every page's <head> carries . The commit comes from a Docker build argument that Coolify passes only if "Include Source Commit in Build" is on. Until Day turns that on, the tag reads unknown

Two stories, one commit each: 24.6 and 24.7. ▎ ▎ - 24.6: A missing URL now shows the site's own 404 page instead of the homepage with a 200. nginx redirects are relative, so they stay on https behind Coolify's TLS proxy (one hop, not a detour through http). Every page's <head> carries <meta name="build" content="<commit> <time>">. The commit comes from a Docker build argument that Coolify passes only if "Include Source Commit in Build" is on. Until Day turns that on, the tag reads unknown <time>. A directory with no index page answers with the 404 page, and a missing file under /api/ answers with a small JSON 404 that carries the CORS header. ▎ - 24.7: The Navigator, Matrix, tool and domain pages move from /prototype/... to /navigator/, /matrix/, /protocols/{id}/ and /domains/{slug}/, in all three languages. The QA fixture moves to /qa/definition-popover/. Every old URL gets one 301 from nginx with the query string kept, so the Navigator's deep links survive. The lowercase /en/ and /pt-br/ forms take two steps. Any other /prototype/ URL is a 404. ▎ ▎ After this deploys: Please run node scripts/check-redirects.mjs <url> against the PR preview, and again against production. It checks all the old URLs and the 404 and query-string cases, and it passed 58 of 58 on a real local nginx. ▎ ▎ Tests: A real nginx image checked the redirects, the 404 behaviour and all 1,068 sitemap URLs. The code was reviewed in three layers and all patches applied. A targeted regression on Chromium, Firefox and WebKit (12 spec files) gave 0 failures. Four known load-sensitive tests failed once and passed on retry. The full suite was replaced by a targeted run at Brandon's call. ▎ ▎ Open after merge: The Coolify setting (Day). The production check of the redirects and the build tag. The full suite run against production in Chrome.
A URL that does not exist now shows the site's own 404 page (src/pages/404.astro, English only, noindex, no language switcher and no hreflang alternates because one page serves every locale). Every page's <head> carries <meta name="build" content="<7-character commit> <UTC time>">, read once per build (src/lib/buildInfo.ts): SOURCE_COMMIT, else the local git commit, else "unknown"; an invalid SOURCE_COMMIT is warned about. The Dockerfile declares ARG SOURCE_COMMIT after npm install (so a new commit does not redo the dependency install) and hands it to the build. A urlPath() test helper accepts a URL with or without the trailing slash, a query string and a hash. BaseLayout gets a "localized" flag for pages that exist in one language only.

The nginx change that makes redirects relative and missing pages 404 (absolute_redirect off, error_page 404/403, the /api/ JSON 404, /404.html internal), the Nav language-switcher flag, the README section and the URL checks in the existing specs ride in the next commit (24.7), which edits the same files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Navigator, Matrix, tool and domain pages move from /prototype/... to /navigator/, /matrix/, /protocols/{id}/ and /domains/{slug}/ in all three locales (git mv: history kept); the QA fixture moves to /qa/definition-popover/ (noindex, not in the sitemap); the three duplicate plain Navigator pages and the unused config.ts are deleted. Every link in src/ and public/ (menu, home button, islands, the MA and Entity Placement scripts, research markdown, topology helpers, the domain breadcrumb data) and about 236 test references use the new URLs; the menu's active-state check matches path boundaries. nginx sends each old URL, in every locale and with or without the trailing slash, ONE 301 to the new URL with the query string kept (the lowercase /en/ and /pt-br/ forms take two steps); any other /prototype/ URL is a 404. scripts/check-redirects.mjs checks all of it against a running site (58 checks; run it on the PR preview and on production); tests/permanent-urls.spec.ts covers the build.

Also in this commit because it edits the same files: the 24.6 nginx changes (relative redirects, missing pages and index-less directories answer the site 404 page, a missing file under /api/ is a small JSON 404 with the CORS header, /404.html only as the error page), the Nav language-switcher flag, the README section, and the 24.6 URL-helper changes to the existing specs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openhaven/openhaven.net!55
No description provided.