Audit the built HTML for SEO invariants and the live site once per crawler #228
Labels
No Label
P0
P1
P2
P3
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
phase-7
phase-8
release-blocker
security
seo
ui
ux
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#228
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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 is true now. Nothing checks the built HTML:
<SEO>on a page ships two titles and two canonicals;<title>at all;scripts/deploy.sh:430-458checks only/api/health.What to do.
scripts/lib/html-audit.jsplusscripts/audit-html.js.scripts/verify.d/15-built-html(mode 755, after10-build): exactly one title, one description, one canonical equal to the site origin plus the route, and one h1 per page; JSON-LD parses and has no FAQPage; no U+2014; the preload matches the hero; internal links and fragments resolve; no run-on descriptions;404.htmlis noindex and not in the sitemap; the sitemap equals the route list. Exit 2 whendist/is stale or missing.--url): every sitemap URL fetched once per crawler (OAI-SearchBot, PerplexityBot, ClaudeBot, Googlebot, bingbot). HTTP 200, identical bytes across agents, the same page checks, andlastmodpresent. A by-hand check after a deploy, not a gate.Traps. The page body is one line and entities are escaped: parse, never
grep -c. Strip comments first; theindex.htmltemplate contains a commented<link rel="preload">. A spoofed agent string is not the real crawler.Verify:
bash scripts/verify.shshows guard 15-built-html passing; each proof mutation (a doubled title, a wrong canonical, a second h1, broken JSON-LD, a FAQPage, an em dash in JSX, a link to/servicez,#contact-forms) fails it with exactly one finding; andnode scripts/audit-html.js --url https://queuenorth.comexits 0 after the release.Done in
ee5186c. scripts/lib/html-audit.js plus scripts/audit-html.js, wired as guard 15-built-html after 10-build. Build mode requires per page exactly one title, description, canonical (site origin plus route) and h1, JSON-LD that parses with no FAQPage, no em dash or U+FFFD, a preload naming the actual hero, and no run-on description; across pages every internal link and fragment must resolve, the sitemap must equal the route list, and 404.html must carry noindex and no canonical. It exits 2 when dist/ is missing or stale. URL mode fetches every sitemap page once per crawler (OAI-SearchBot, PerplexityBot, ClaudeBot, Googlebot, bingbot), requiring 200, identical bytes and a lastmod. Proven by nine mutations, each caught: wrong canonical (7 pages), second h1 (4), FAQPage, em dash in copy, link to a missing route (18), fragment not on target (7), preload keyed on the old attribute (19), template title left in place (19), industry routes dropped (56). Clean build audits clean; URL mode passes against localhost as all five crawlers. Harness: scratchpad/prove-audit.sh.