fix(sim): content-hash media URLs + fade pool-landing clip swap #23

Merged
benstull merged 1 commits from fix/media-versions-and-pool-landing into main 2026-06-25 20:04:16 +00:00
Owner

Two media-handling fixes surfaced by the cosmos swap.\n\n1. Permanent cache-bust (content hash). New GET /api/media-versions returns a sha1 token per served file (cached by mtime/size, so re-bakes are picked up without a restart). The client appends ?v=<hash> to /media URLs → a re-baked clip gets a fresh URL the browser cannot serve stale. Fixes the recurring stale-clip problem at the root.\n\n2. Fade the pool-landing swap. The baked ring transition lands on the scale PRIMARY, but the rotating pool picks a random member — so a non-primary pick hard-cut from the primary to the chosen clip (coast birdrock → surfgrass, the artifact reported). Now masked behind a short fade through the existing #black overlay when the pick ≠ primary; general across all pooled scales.\n\n271 passed, 2 skipped (+2). Endpoint verified live (token matches a manual sha1).\n\n🤖 Generated with Claude Code

Two media-handling fixes surfaced by the cosmos swap.\n\n**1. Permanent cache-bust (content hash).** New `GET /api/media-versions` returns a sha1 token per served file (cached by mtime/size, so re-bakes are picked up without a restart). The client appends `?v=<hash>` to /media URLs → a re-baked clip gets a fresh URL the browser cannot serve stale. Fixes the recurring stale-clip problem at the root.\n\n**2. Fade the pool-landing swap.** The baked ring transition lands on the scale PRIMARY, but the rotating pool picks a random member — so a non-primary pick hard-cut from the primary to the chosen clip (coast birdrock → surfgrass, the artifact reported). Now masked behind a short fade through the existing `#black` overlay when the pick ≠ primary; general across all pooled scales.\n\n271 passed, 2 skipped (+2). Endpoint verified live (token matches a manual sha1).\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 1 commit 2026-06-25 20:04:13 +00:00
Two fixes to the simulator's media handling, both surfaced by the cosmos clip swap.

1. Permanent cache-bust via content hash. New `GET /api/media-versions` returns a
   short sha1 token per served file (clip bases + ring transitions + reverses),
   cached by (mtime, size) so a re-bake is picked up without a restart. The client
   fetches it at boot and appends `?v=<hash>` to every /media URL, so a clip
   re-baked under the same path (e.g. a re-sourced cosmos base) gets a fresh URL
   the browser can't serve stale — fixing the recurring stale-clip problem at the
   root (supersedes the `cache: "reload"` belt-and-suspenders, which stays).

2. Fade the pool-landing swap. The baked ring transition zooms into the scale
   PRIMARY, but the rotating pool picks a random member on landing — so a
   non-primary pick hard-cut from the primary to the chosen clip (e.g. coast
   birdrock -> surfgrass, the artifact the operator saw). On landing, when the pick
   differs from the primary, mask the swap behind a short fade through the existing
   #black overlay (CSS opacity transition); same-clip landings still do a plain
   (re)load. General across all pooled scales.

271 passed, 2 skipped (+2: media-version content-hash + absent-file omission).
app.js syntax-checked; endpoint verified live (29 files; token matches a manual
sha1 of the bytes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benstull merged commit 5bb762ae53 into main 2026-06-25 20:04:16 +00:00
Sign in to join this conversation.