Repository navigation
Scaling E2: one CDN cache rule for soul.game that the release's own check accepts (#2514) - #2574
Conversation
…s own address (#2513) A site file (soul-game.caddy) replaces X-Forwarded-For with exactly {client_ip}; a trust snippet imported in the Caddyfile's global options trusts CF-Connecting-IP only from the CDN's published ranges. GET /__sim/whoami answers the address the launcher keyed a request on, and deploy/caddy/check-soul-game.mjs checks six points from outside. docs/operations/cdn.md carries the ordered hands-on steps and the rollback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eck accepts, with a check that proves the hit (#2514) The rule's paths are derived from origin-cache.mjs's hashed and stable classes plus the keyed snapshot; cdn.md carries the expression verbatim (tested), check-soul-game.mjs gains a cache point (each class twice, the second a hit; a stale snapshot key no-store), and the runbook says when to purge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Proof check:
|
| Check | Status | Detail |
|---|---|---|
| problem statement | ok | present |
| linked issue | ok | #2514 |
| acceptance | ok | 3/3 met |
| carried from the issue | ok | all 3 issue criteria present |
| self-audit | ok | checks, failed attempts, long tail and limits filled |
Acceptance criteria
| Criterion | Status | Evidence | |
|---|---|---|---|
| [x] | A1 tools/cdn/origin-cache.test.* (or a new test) shows every hashed and |
met | node --test tools/cdn/origin-cache.test.mjs -> test "E2 A1" passes: one sample per hashed and stable class (bundle, st |
| [x] | A2 The check script's cache section passes against a local caching proxy | met | node --test tools/cdn/origin-cache.test.mjs -> "E2 A2" passes, output: |
| [x] | A3 The documented rule set and the two runbook lines are in `docs/operati | met | docs/operations/cdn.md "The cache rule" (expression, four settings, why it is safe); purge lines for a moderation veto |
Proof links: 0 video, 0 image, no proof.json.
Updated on every edit, push, label and review. How to fill it: .claude/skills/journal/SKILL.md. T3-T4 also need the maintainer's sign-off (tools/proof/gate.mjs). A maintainer can waive with the proof:waived label.
3-way merge against the fork point from the old base (3b984bb), by .github/scripts/restack.mjs.
|
Restack: #2567 squash-merged into
Head |
Problem
Every release runs
cdn-walk, which fails any hashed or release-stable origin response whose cache status isDYNAMICorBYPASS(tools/cdn/origin-cache.mjs). A CDN caches by extension by default and never JSON or extension-less paths, so the daysoul.gameis proxied, parts, profile photos and the snapshot would readDYNAMICand fail every release. The zone's rules were not in the repository. Closes #2514.Base: E1's branch
agent/2513-cdn-frontuntil it lands, then main.Acceptance
tools/cdn/origin-cache.test.*(or a new test) shows every hashed and stable class accepted with a cache status of hit or miss and refused with dynamic or bypass, matching the documented rule. — evidence:node --test tools/cdn/origin-cache.test.mjs-> test "E2 A1" passes: one sample per hashed and stable class (bundle, stored object at root and per world, part, art, profile photo,/modular,/mars-assets,/world-assets, a font) is eligible undercdnCacheEligible, gives no problem with HIT, MISS, EXPIRED or REVALIDATED and aCloudflare DYNAMIC/BYPASSproblem otherwise; the page,/v1/config, the world list,/__sim/*, edge and god routes are not eligible. Test "E2 A3" checkscdn.mdcarriescdnRuleExpression()verbatim.node --test tools/cdn/origin-cache.test.mjs-> "E2 A2" passes, output:partandsnapshotbehind a stand-in with the CDN's by-extension default, and fails when the origin lets a stale key be cached.docs/operations/cdn.md. — evidence:docs/operations/cdn.md"The cache rule" (expression, four settings, why it is safe); purge lines for a moderation veto and after a restore indocs/operations/runbook.md(in Touches), linked from the rule.Proof
Tier: T1 (
node tools/proof/tier.mjs --files <the five files>-> T1, fromcheck-soul-game.mjs)Self-audit
node --test tools/cdn/origin-cache.test.mjs tools/world-launcher/check-soul-game.test.mjs-> 13 pass, 0 fail, 0 skipped (the E1 Caddy tests ran with the localcaddy). No typecheck: only.mjstools and docs changed.node .github/scripts/guards.mjs scrub --base origin/agent/2513-cdn-front-> 0 problems.checkSoulGame's default points stay the six of E1 (its tests unchanged); the CLI runs all seven, so before the record is proxied it failsaddressandcache(documented).strict wildcard, which every plan has; purging by prefix needs a plan that has it, else purge everything (runbook).docs/operations/cdn.md(rule, check's new point, hands-on step 5 now links the rule),docs/operations/runbook.md(purges).Deviations from the design
origin-cache.mjs(CDN_CACHE_RULE) that produce both the predicate the tests use and the expression the doc carries, so the doc cannot drift from the classes. It uses soul.game's root-launcher paths (no/worldsprefix).tools/cdn/origin-cache.test.mjs(in Touches) rather thancheck-soul-game.test.mjs(outside Touches). The cache point is not incheckSoulGame's default list for the same reason: E1's tests run the default list against a stand-in without a world page.DYNAMIC) was not needed: every class can be made eligible.Outside Touches
None.
Time
Started 07:40 UTC, PR ready at about 07:55 UTC: about 15 minutes against a 2 h ceiling.
Changelog
no-changelog: tools and operations docs only; nothing a visitor or agent sees changes until the hands-on switch.Risk
None at runtime. The rule takes effect only when the operator applies it with the switch (hands-on step 5). If a path it makes eligible ever answered per user with a public cache header, the edge would share it; the rule excludes
/v1/and/__sim/from static patterns and lists only three public API reads for that reason. Rollback is deleting the rule in the zone.🤖 Generated with Claude Code