feat(docs): triage script for 404 exports - #98
Open
coderdan wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The raw Vercel 404 export is unreadable: 4,771 of 5,000 rows in the
2026-08-26 → 08-31 window were Next.js client segment-cache prefetches,
burying the ~230 failures worth acting on under 95% noise.
`bun run triage-404s <export.csv>` dedupes by requestId (the export
repeats rows), buckets by shape, drops the prefetch noise, and prints
what is left with requester attribution — AI agent, search crawler,
other bot, browser. Run against that export it reports 229 actionable
requests across 175 distinct paths, which is what the redirect map was
built from.
The segment prefetches 404 because segment data is only generated when
`cacheComponents` is on. Reproduced directly:
curl -H 'Next-Router-Segment-Prefetch: /_tree' \
'.../docs/reference/agent-skills.segments/_tree.segment.rsc' -> 404
Without that header the same URL returns 200. The router falls back to a
normal prefetch, so nothing is broken for the reader — it is ~1,500
wasted requests a day and a ruined 404 report. Next 16.2.6 has no flag
to turn the client segment cache off; enabling `cacheComponents` is the
real fix, tracked in CIP-3910.
Not wired into prebuild: it reads a file that only exists once someone
has pulled an export.
Claude-Session: https://claude.ai/code/session_01BsA6C8Y48GDjh6ELL8yVjf
coderdan
force-pushed
the
fix/404-triage-and-robots
branch
from
August 31, 2026 07:44
db88c1d to
533a017
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A triage script for Vercel 404 log exports.
Why
The raw export is unreadable. In the 2026-08-26 → 08-31 window, 4,771 of 5,000 rows were Next.js client segment-cache prefetches — the ~230 failures worth acting on sat under 95% noise, and the top of any naive 404 report is entirely
*.segment.rsc.Dedupes by
requestId(the export repeats rows), buckets by shape, drops the prefetch noise, and prints what is left with requester attribution. Against that export:That output is what the redirect map in #97 was built from. Not wired into prebuild — it reads a file that only exists once someone pulls an export.
The
source-refbucket (46 requests) is worth its own look: paths like/docs/integrations/prisma/execution/envelope-json.ts:44. Docs prose emitsfile.ts:NNstrings that agents resolve as links. No redirect fixes that; it is a content fix.Why the segment prefetches 404
Segment data is only generated when
cacheComponentsis on. Reproduced against production:The router falls back to a normal prefetch, so nothing is broken for the reader — the cost is ~1,500 wasted requests a day (current 24h Vercel counts: 1,498 × 404 against 144 × 200) and a ruined 404 report.
Next 16.2.6 exposes no flag to turn the client segment cache off — there is no
clientSegmentCachekey in its config schema. EnablingcacheComponentsis the real fix, tracked in CIP-3910. This PR classifies the noise rather than pretending to eliminate it.Dropped from this PR
An earlier revision added
/docs/robots.txt. Removed: robots.txt is only ever read at the origin root, which the marketing app owns and which already allows everything and lists this app's sitemap. A second file on the same host would be inert, and a future edit to it — aDisallowscoped to the docs — would look correct, deploy cleanly, and do nothing.The one request for
/docs/robots.txtin the log window turned out to be my owncurlprobe while investigating, not an agent.Checks
npm run types:check— cleanbiome check— cleantriage-404srun against the real export, output abovehttps://claude.ai/code/session_01BsA6C8Y48GDjh6ELL8yVjf