The Netlify validation job imports site listings before generated static device JSON exists in a clean checkout, so keep the small device table in tracked source and use it as the route fallback.
Constraint: static/device-list.json is ignored generated output and is absent in GitHub-hosted clean runners
Rejected: Force-add static/device-list.json | keeps generated output under source control
Confidence: high
Scope-risk: narrow
Directive: Keep disabled device rows in the fallback source but filter them from routable listings
Tested: pnpm run with-env vitest ./test/prebuild/site-listings.test.js
Tested: pnpm netlify-build reached Astro build after passing prebuild tests
Not-tested: Full local netlify-build completion blocked by unrelated uncommitted scanner worker build failure
The first baseline committed the raw YouTube API dump, which fixed clean builds but carried unused API metadata. The route fallback only needs prebuilt listing objects, so this replaces the raw seed with slug-keyed listing fallbacks and adds a refresh script that fetches the latest source data before projecting it.
Constraint: helpers/site-listings.js must work in a fresh checkout before generated static/api output exists
Rejected: Commit the full raw YouTube JSON | unnecessarily large and mostly unused by the fallback path
Rejected: Drop descriptions only | smaller but would weaken app-link and tag matching semantics
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Refresh static/api/youtube-video-listings.json via scripts/update-youtube-video-listing-fallbacks.js, not by committing static/api/youtube-videos.json
Tested: pnpm run with-env vite-node scripts/update-youtube-video-listing-fallbacks.js
Tested: pnpm run with-env vitest test/prebuild/site-listings.test.js
Tested: pnpm run netlify-prebuild:test-prebuild-functions
Tested: pnpm run netlify-prebuild
The previous route fallback fix worked locally but still failed on production because the Netlify SSR runtime did not have repo-local JSON files available at the paths the helper searched.
Switch the fallback helper to raw-import the generated app, game, device, and YouTube JSON inputs so the SSR bundle carries the data it needs at runtime, independent of function working directory or file packaging quirks.
Constraint: Netlify SSR bundling does not reliably expose repo-local generated files as runtime-readable filesystem paths
Rejected: Rely on Netlify included_files for SSR bundle data | the generated SSR function archive still omitted the fallback files
Rejected: Fetch large fallback JSON over HTTP on each request | unnecessary network dependency for a server-side fallback path
Confidence: medium
Scope-risk: narrow
Reversibility: clean
Directive: Prefer bundler-native inclusion for SSR-only fallback data when runtime file availability is uncertain on Netlify
Tested: vitest ./test/prebuild/config-node.test.js ./test/prebuild/site-listings.test.js; pnpm run netlify-build
Not-tested: live production after redeploy
Add a Bun health script that exercises top-level, dynamic, and representative video routes against one or more hosts so prod regressions are visible from a single command.
Device pages now fall back to the bundled device list when the external API misses a slug, and orphaned tv slugs redirect to /benchmarks instead of returning a 500. Video fallback logic reuses the existing YouTube-to-listing builder so route reconstruction stays aligned with the current build logic.
Constraint: The external API host can lag behind the frontend build and omit per-slug JSON files that public routes still expect
Rejected: Import the generated video list directly | static/video-list.json is too large for a safe SSR fallback
Rejected: Leave missing tv routes as 500s | a stale public URL should degrade to a useful redirect instead of breaking the request
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep route fallbacks tied to build-time artifacts from the same repo so frontend and fallback data stay in sync
Tested: bun scripts/health http://127.0.0.1:4322; vitest ./test/prebuild/config-node.test.js ./test/prebuild/site-listings.test.js; pnpm run netlify-build
Not-tested: live production deploy before push