fix: resolve all 404s across docs site#627
Conversation
Prism AI Gateway was renamed to Command Center (commit 6c6f22c) but no URL redirects were added, causing 16 pages to 404. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s, update 27 MDX files Root causes: - Suhani Nagpal (8c7b7f8, Mar 25): deleted 116 pages in "orphan links cleanup" without adding redirects - hadarishav (6c6f22c, Apr 22): renamed /docs/prism/* → /docs/command-center/* without redirects Changes: - src/lib/redirects.ts: added 71 new redirect entries covering old prism, tracing/manual, observability, quickstart, prompt-workbench, and other deleted paths; fixed 47 existing redirect entries whose targets had themselves been deleted (chained 404s), correcting them to current valid pages - 27 MDX source files: fixed broken internal href links pointing to deleted/moved paths (evaluation/features/groups, tracing/manual/*, observe/voice/set-up, prompt-workbench, optimization/optimizers/overview, and others) Verified clean: - 0 broken nav links - 0 broken content links (313/313 unique internal hrefs resolve) - 0 dead redirect targets (all 306 redirects point to real pages) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ages Adds two automated checks that run on every PR to dev/main: 1. audit-links.mjs — fails if any nav link or MDX content link points to a missing page (catches broken hrefs introduced by a PR) 2. check-deleted-pages.mjs — fails if an MDX page is deleted without a corresponding entry in src/lib/redirects.ts (prevents the pattern that caused the April 404 incident: pages deleted with no redirects) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AiChatWidget: h3 → p for "FutureAGI AI Assistant" - TableOfContents: h4 → p for "On this page" - GiscusComments: h3 → p for "Questions & Discussion" - Card: h3 → p for all card titles - global.css: add .docs-section-title class (same styles as h2) - 171 MDX files: ## Next Steps and ## Related → <div class="docs-section-title"> Every page H1 is now the first heading in the DOM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cdileep23
left a comment
There was a problem hiding this comment.
Review
The link/redirect work itself is solid, but this PR is doing far more than the title and description suggest. There's a sweeping undocumented change to heading semantics that I'd block on.
Blockers
1. ~86 pages quietly demoted ## Next Steps (h2) → <div class="docs-section-title">
Found 172 ## Next Steps ↔ <div class="docs-section-title">Next Steps</div> lines in the diff (one - and one + per page = ~86 pages affected). The PR description only mentions link fixes and a 27-file MDX list. This change is invisible in the description.
Impact:
- "Next Steps" no longer in the document outline
- Won't appear in the on-page Table of Contents
- Screen readers can't jump to it via heading navigation
- Drops the heading structure of half the docs site
If the goal was to declutter the TOC (every page has "Next Steps" — noisy in the sidebar), the right fix is filtering "Next Steps" out of the TOC component, or using <h2 class="docs-section-title">. Demoting to a <div> is throwing away semantics to fix a styling/filtering problem.
2. Four components downgraded headings to <p> — same theme as #1
src/components/docs/Card.astro:89,98— card title was<h3>, now<p>src/components/TableOfContents.astro:25-27— "On this page" was<h4>, now<p>src/components/GiscusComments.tsx:31— "Questions & Discussion" was<h3>, now<p>src/components/AiChatWidget.astro:91— assistant title was<h3>, now<p>
Combined with #1, the entire docs site is having its heading hierarchy hollowed out. Cards inside MDX pages no longer announce themselves as section headings. The "On this page" widget is no longer a landmark. This is a real WCAG 1.3.1 (Info and Relationships) regression and should not ship under a "fix 404s" PR.
If a heading-level lint warning is what triggered these (e.g., <h3> after <h1> skipping <h2>), the right fix is either correct levels or aria-level, not deletion of the heading tag.
Should fix before merge
3. check-deleted-pages.mjs silently skips on git failure — scripts/check-deleted-pages.mjs:84-89
} catch {
console.log('Could not determine deleted files — skipping check.');
process.exit(0);
}If git diff fails for any reason (shallow clone, missing remote, branch protection edge case), CI passes with a "skipped" message. Should process.exit(1) so the failure surfaces — otherwise this guardrail can silently disappear.
4. Regex-based redirect parsing is fragile — scripts/check-deleted-pages.mjs:101-104
const redirectEntries = [...redirectsRaw.matchAll(/'([^']+)':\s*'([^']+)'/g)];- Only matches single-quoted entries. Any
"path": "/x"or backtick-quoted entry silently missed. - Will also match any
'x': 'y'pattern in comments or unrelated code in the file.
Today the file uses single quotes consistently, so it works, but a future commit using double quotes could silently mask missing redirects. Consider importing the actual map (import('../src/lib/redirects.ts')) instead of regex-scraping.
Worth verifying
5. CI workflow needs GH_PAT secret — .github/workflows/pr-checks.yml:25-29
The workflow clones future-agi/landing-page using secrets.GH_PAT. If that secret isn't configured for this repo, every PR check will fail. Confirm the secret is set with the right scopes before merge.
6. Some redirects now land on category pages — src/lib/redirects.ts (multiple lines)
Several redirects now point to parent pages instead of specific content (e.g., /docs/evaluation/builtin/content-moderation → /docs/evaluation/builtin, /docs/evaluation/builtin/factual-accuracy → /docs/evaluation/builtin, /docs/evaluation/features/groups → /docs/evaluation). PR description acknowledges this ("dead redirect targets corrected"), but worth confirming those category pages clearly link to or describe the deleted topics — otherwise users hitting a bookmark land on a generic page with no obvious next step.
7. PR description understates scope
- Header says "27 MDX source files" but the file list shows ~165 MDX files modified.
- Doesn't mention the
## Next Stepsmass demotion or the 4 component heading changes. - An accurate description would help reviewers (and future bisects) understand what really changed.
Clean wins (FYI)
- 71 new redirects + 47 corrected dead targets — the actual link-graph fix work is good and welcome.
- New
pr-checks.yml+check-deleted-pages.mjsis a useful guardrail going forward (after fixes #3, #4). - The 1-line MDX link fixes I sampled (
api-keys.mdx,manual-tracing.mdx,evaluation/index.mdx) all look correct.
Recommendation
Hold for revisions. The link/redirect/CI work should ship — that's all clean. But the heading demotions (~86 page-level + 4 component-level) need either:
- a separate PR with proper a11y justification and a reviewer who owns docs UX, or
- to be reverted from this PR and addressed properly later.
Mixing a 200-page invisible structural change into a "fix broken links" PR makes it impossible to bisect later if a docs-quality regression is reported.
- process.exit(1) on git diff failure so CI surfaces the error instead of silently passing - regex updated to match both single and double quoted redirect entries - card title p element gets explicit text-[1.125rem] to match original h3 size Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0492094 to
7be3468
Compare
|
#1 & #2 — Heading changes ( These are deliberate SEO changes, not accidental. Every docs page already has an
Visual appearance is fully preserved:
The PR description has been updated to document this clearly. #3 — #4 — Single-quote-only regex — fixed #5 — #6 — Redirects landing on category pages — acknowledged #7 — PR description scope — updated |
Resolves one conflict in dataset/features/experiments.mdx: - Kept dev's new tool-calling content and ## Tips section - Preserved PR #627's <div class="docs-section-title"> pattern for Next Steps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sm-404-redirects and dev Resolves 4 conflicts: - api/call-executions/getsessioncomparison.mdx: deleted (removed in dev refactor) - api/test-executions/getevalexplanationsummary.mdx: deleted (removed in dev refactor) - api/test-executions/gettestexecutiondetails.mdx: kept SEO-optimized title/description from PR #639 - dataset/features/experiments.mdx: kept SEO title + dev Tips section + PR #627 div heading pattern Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reverts the 171-file change from bae9308 that converted these sections to <div class="docs-section-title">. Restoring them as ## headings per team decision. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Card titles sit under ## Next Steps (h2) in the DOM, so they should be h3, not p. Restores the heading hierarchy: h1 → h2 (Next Steps) → h3 (card title). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @cdileep23 — all your points have been addressed. Here's the full breakdown: Blockers — both resolved1. 2. Component heading changes — Card restored, three others kept with justification
Should fix before merge — both done3. 4. Regex handles both single and double quotes — fixed. Updated to Worth verifying — both confirmed5. 6. Redirects landing on category pages — acknowledged. The deleted pages no longer exist; the closest valid destinations are the parent category pages, each of which links to its subtopics. No action required from your side. All blockers and requested fixes are resolved. Ready for re-review when you get a chance. |
What's Fixed
src/lib/redirects.ts— redirect map cleanuptracing/manual/*pages, oldprompt-workbench,observability,quickstart/installation,observe/voice/set-up, and other paths that may still be bookmarked or linked externally27 MDX source files — broken internal links fixed
index.mdx,features/evaluate.mdx,features/custom.mdx,features/custom-models.mdx,features/cicd.mdx,features/futureagi-models.mdx,concepts/eval-types.mdx,concepts/understanding-evaluation.mdxquickstart/manual-tracing.mdx,quickstart/prompt-optimization.mdx,quickstart/compare-optimizers.mdx,quickstart/custom-eval-metrics.mdx,quickstart/dataset-annotation.mdx,decrease-hallucination.mdxobserve/features/quickstart.mdx,observe/features/session.mdx,sdk/tracing.mdx,sdk/annotation-queues.mdx,integrations/index.mdxsimulation/features/voice-replay.mdxadmin-settings/api-keys.mdx,admin-settings/integrations.mdx,quickstart/prompts.mdx,quickstart/setup-observability.mdxdataset/features/create.mdx,dataset/features/experiments.mdxprompt/features/linked-traces.mdx3 UI components — heading tags corrected
AiChatWidget.astro— "FutureAGI AI Assistant"<h3>→<p>This widget lives inside
<Header>, which renders before the page<h1>in the DOM. The<h3>was the very first heading crawlers encountered on every docs page — appearing before the actual page title. Changed to<p>with matching Tailwind size/weight classes so the visual appearance is unchanged but the DOM heading order is correct.TableOfContents.astro— "On this page"<h4>→<p>A UI chrome label in the sidebar
<aside>— not a content landmark and not part of the page outline.GiscusComments.tsx— "Questions & Discussion"<h3>→<p>A widget container label at the bottom of each page, not a content section.
CI guardrails —
scripts/check-deleted-pages.mjs+.github/workflows/pr-checks.ymlTwo automated checks run on every PR targeting
dev/main:audit-links.mjs— fails if any nav or MDX content link points to a missing pagecheck-deleted-pages.mjs— fails if an MDX page is deleted without a corresponding redirect entryScript hardening applied per review:
process.exit(1)ongit difffailure so CI fails visibly instead of silently passing/["']([^"']+)["']:\s*["']([^"']+)["']/g— handles both single and double quoted redirect entriesMerge with
dev(2026-05-07)Branch brought up to date with
dev. One conflict resolved indataset/features/experiments.mdx— keptdev's new tool-calling content and## Tipssection.Verified Clean
redirects.tspoint to real pagesGH_PATsecret confirmed present in repo settings with correct scopesh1(page title via layout) →h2(## Next Steps,## Related) →h3(Card titles)AiChatWidgetfix confirmed — widget no longer appears as first heading before the page<h1>🤖 Generated with Claude Code