ai-code-battle/cmd/acb-index-builder
jedarden 4b7d81db45 feat(index-builder): bundle warm-set replays as static Pages assets
Per bead bf-3e60: instead of copying B2->R2 (warm cache), bundle warm-set
replays, thumbnails, cards, and evolution live.json directly into the Pages
deploy directory as static assets (dist/data/). This serves replays same-origin,
eliminating R2 dependency and 404 errors.

Changes:
- Add B2Client interface for testable B2 operations
- Add bundleWarmReplays(): copies replays/*.json.gz from B2 to dist/data/replays/
- Add bundleWarmThumbnails(): copies thumbnails/*.png from B2 to dist/data/thumbnails/
- Add bundleWarmCards(): copies cards/*.png from B2 to dist/data/cards/
- Add bundleEvolutionLive(): copies evolution/live.json from B2 to dist/data/evolution/
- Replace promoteRecentReplaysForCycle() with bundleWarmAssetsForCycle()
- Remove R2 pruning logic from main loop (no longer needed)
- Add unit tests for all bundling functions with mock B2 client

Replays are served gzipped (as-is from B2) to keep deploy size under Pages'
25MB file limit. Frontend will gunzip client-side (separate bead bf-5cwi).

All tests pass (go test ./...).

Closes: bf-3e60
2026-05-26 07:35:48 -04:00
..
blog.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
cards.go Implement S3 functions for R2/B2 integration in acb-index-builder 2026-03-29 09:09:29 -04:00
config.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
db.go feat(index-builder): generate evolution/meta.json and lineage.json 2026-05-25 16:01:27 -04:00
deploy.go feat(index-builder): bundle warm-set replays as static Pages assets 2026-05-26 07:35:48 -04:00
Dockerfile fix(index-builder): run wrangler from /app/web to pick up functions/ bundle 2026-04-30 12:39:57 -04:00
enrichment.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
enrichment_test.go fix(index-builder): correct series/season exempt queries, optimize playlist curation 2026-04-21 16:47:13 -04:00
generator.go feat(index-builder): generate evolution/meta.json and lineage.json 2026-05-25 16:01:27 -04:00
main.go feat(index-builder): bundle warm-set replays as static Pages assets 2026-05-26 07:35:48 -04:00
main_test.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
narrative.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
narrative_test.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
rivalry_test.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
s3.go style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
s3_test.go feat(index-builder): bundle warm-set replays as static Pages assets 2026-05-26 07:35:48 -04:00
sitebuild.go fix(types): add missing ReplayPlayer import and type annotation for transcript feature 2026-04-22 18:20:56 -04:00
sitebuild_test.go fix(types): add missing ReplayPlayer import and type annotation for transcript feature 2026-04-22 18:20:56 -04:00