docs(bf-5kk): standardize on ai-code-battle.pages.dev as canonical public domain
- Update replay-schema-v1.json to pages.dev - Update robots.txt sitemap URL to pages.dev - Update test-match-list.html thumbnail URLs to pages.dev/r2/ - Add decision note documenting standardization All user-facing absolute URLs now use the working pages.dev origin. The aicodebattle.com domain is NXDOMAIN and was never registered. R2 data is served through Pages Functions (/r2/*) eliminating the need for a separate b2.aicodebattle.com CDN host. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ad73532da2
commit
90f4ed7507
4 changed files with 75 additions and 3 deletions
72
docs/notes/canonical-public-domain.md
Normal file
72
docs/notes/canonical-public-domain.md
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
---
|
||||
name: canonical-public-domain
|
||||
description: Standardized on ai-code-battle.pages.dev as canonical public domain
|
||||
metadata:
|
||||
type: project
|
||||
---
|
||||
|
||||
# Canonical Public Domain Decision
|
||||
|
||||
## Decision
|
||||
|
||||
**Standardized on `ai-code-battle.pages.dev` as the canonical public domain.**
|
||||
|
||||
## Background
|
||||
|
||||
The domain `aicodebattle.com` is NXDOMAIN (not registered). The site is deployed and functional at `ai-code-battle.pages.dev`. References to `aicodebattle.com` and `b2.aicodebattle.com` existed in documentation and test files.
|
||||
|
||||
## Rationale
|
||||
|
||||
- Registering `aicodebattle.com` requires human action and payment
|
||||
- Cloudflare Pages provides a production-ready public URL at `ai-code-battle.pages.dev`
|
||||
- R2 storage is now served through Pages Functions (`/r2/*` path), eliminating the need for a separate `b2.aicodebattle.com` CDN host
|
||||
- Standardizing on pages.dev ensures all user-facing URLs work immediately
|
||||
|
||||
## Changes Made
|
||||
|
||||
### Updated Files
|
||||
|
||||
1. **web/public/replay-schema-v1.json**
|
||||
- Updated `$id` field from `https://aicodebattle.com/replay-schema-v1.json` to `https://ai-code-battle.pages.dev/replay-schema-v1.json`
|
||||
|
||||
2. **web/public/robots.txt**
|
||||
- Updated sitemap URL from `https://aicodebattle.com/sitemap.xml` to `https://ai-code-battle.pages.dev/sitemap.xml`
|
||||
|
||||
3. **web/public/test-match-list.html**
|
||||
- Updated thumbnail URL from `https://b2.aicodebattle.com/thumbnails/...` to `https://ai-code-battle.pages.dev/r2/thumbnails/...`
|
||||
|
||||
### Files Already Correct
|
||||
|
||||
- **web/src/og-tags.ts** - Already uses `https://ai-code-battle.pages.dev`
|
||||
- **web/src/pages/playlists.ts** - Uses dynamic `window.location.origin` for embed URLs
|
||||
- **web/src/pages/clip-maker.ts** - Twitter share uses external domain (correct)
|
||||
- **web/index.html** - OG tags already use pages.dev
|
||||
- **web/embed.html** - OG tags already use pages.dev
|
||||
|
||||
## URL Pattern
|
||||
|
||||
All user-facing absolute URLs now follow the pattern:
|
||||
|
||||
```
|
||||
https://ai-code-battle.pages.dev/<path>
|
||||
```
|
||||
|
||||
Dynamic URLs use `window.location.origin` which resolves to pages.dev in production.
|
||||
|
||||
## Replay and Data URLs
|
||||
|
||||
Replays and match data are served through Cloudflare Pages Functions:
|
||||
|
||||
- Replays: `https://ai-code-battle.pages.dev/r2/replays/{match_id}.json.gz`
|
||||
- Match metadata: `https://ai-code-battle.pages.dev/r2/matches/{match_id}.json`
|
||||
- Thumbnails: `https://ai-code-battle.pages.dev/r2/thumbnails/{match_id}.png`
|
||||
- Bot cards: `https://ai-code-battle.pages.dev/r2/cards/{bot_id}.png`
|
||||
- Evolution status: `https://ai-code-battle.pages.dev/r2/evolution/live.json`
|
||||
|
||||
## Future Consideration
|
||||
|
||||
If `aicodebattle.com` is registered later, it can be added as a custom domain in Cloudflare Pages. The internal URLs will remain valid as pages.dev will continue to work as the origin.
|
||||
|
||||
## Verified
|
||||
|
||||
All user-facing absolute URLs emitted by the web application resolve correctly in a browser.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://aicodebattle.com/replay-schema-v1.json",
|
||||
"$id": "https://ai-code-battle.pages.dev/replay-schema-v1.json",
|
||||
"title": "AI Code Battle Replay Format",
|
||||
"description": "Complete replay format for AI Code Battle matches. Documents the full game state for each turn, enabling third-party tooling and replay viewers.",
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: https://aicodebattle.com/sitemap.xml
|
||||
Sitemap: https://ai-code-battle.pages.dev/sitemap.xml
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@
|
|||
|
||||
if (matchData.matches && matchData.matches.length > 0) {
|
||||
const firstMatch = matchData.matches[0];
|
||||
const thumbnailUrl = `https://b2.aicodebattle.com/thumbnails/${firstMatch.id}.png`;
|
||||
const thumbnailUrl = `https://ai-code-battle.pages.dev/r2/thumbnails/${firstMatch.id}.png`;
|
||||
|
||||
try {
|
||||
const thumbResponse = await fetch(thumbnailUrl, { method: 'HEAD' });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue