Repository navigation
Stop remote classic scripts and send script-src 'self' - #28
Merged
Merged
Conversation
The game document loaded Umami and the session recorder from analytics.stephens.page, and the Llorarás player appended Spotify's iframe API. The document no longer includes those tags, and the player no longer appends that script. The drawer stays on the unavailable state and keeps the Open in Spotify link. The Node static HTML response now sends Content-Security-Policy: script-src 'self'. Apache, Caddy, seat storage, and hot-seat resume storage are unchanged. Tests: packages/client/tests/document.test.ts, packages/client/tests/music-player.test.ts, packages/server/tests/client-assets.test.ts.
The player no longer mounts an iframe, so the blank embed slot and aria-pressed on Open Llorarás were leftovers. The button opens the drawer. The unavailable copy and the Open in Spotify link stay. The static file join uses relativePath for the same .. fallback as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Seams under test:
packages/client/index.html): no classic script from analytics.stephens.page.MusicProvider): mounting it does not append the Spotify iframe API; the drawer says the embedded player could not load; the Open in Spotify link stays.serveClientAssets): an HTML response, including the SPA fallback, sendsContent-Security-Policy: script-src 'self'.Apache (
ops/apache-clave.conf), Caddy (ops/Caddyfile), online seat storage, and hot-seat resume storage are unchanged. No rules change.Evidence
packages/client/tests/document.test.tsfailed becauseindex.htmlcontainedhttps://analytics.stephens.page/script.js.packages/client/tests/music-player.test.tsfailed because the mount appended<script src="https://open.spotify.com/embed/iframe-api/v1">.packages/server/tests/client-assets.test.tsfailed becauseserveClientAssetsdid not exist.After:
npx vitest run packages/client/tests/document.test.ts packages/client/tests/music-player.test.ts packages/server/tests/client-assets.test.tspassed, 5 tests.The Standards check
opens Llorarás as a command, not a pressed toggle or an empty embed wellfailed onaria-pressed="false", then passed after the drawer lost the empty embed well (1f4e2cb). Playwrightoffers Llorarás in Spotify when the embedded player is not loadedpassed on mobile-chrome and desktop-chrome.A request for the built
packages/client/dist/index.htmlthroughserveClientAssetsreturned 200,text/html; charset=utf-8, andscript-src 'self'. The built document's only script is<script type="module" crossorigin src="/assets/index-CIo19HZo.js">. The bundle does not containanalytics.stephens.pageoropen.spotify.com/embed/iframe-api.npm testpassed 101 tests and timed out one pre-existing engine property test at the default 5 seconds (packages/engine/tests/properties.test.ts, "every reported legal action applies and no invariant is breached"). That test passed in 6229ms with--testTimeout=30000. It does not import this change.Merge Danger
Door: two-way
Revert the branch and the document loads the old scripts again. The header is only on the Node HTML response.
Blast Radius: document
clave.dance stops loading Umami (
script.jsandrecorder.js) and stops embedding Spotify. The Open in Spotify link remains. Non-HTML assets do not get the policy. Seat storage and hot-seat resume storage are untouched.Unaddressed findings
Standards
Plan drift. D7 and OQ-3 still say Clave may start and pause Spotify's official embed (scope added 2026-07-20). This branch stops that script and does not amend
docs/plans/clave-plan.md.D7 does not require the embed. It says the web UI may control Spotify's licensed embed (
docs/plans/clave-plan.md, D7, and the non-goal "The app may start and pause the official Spotify embed"). Issue 27 says "No rules change." Whether to withdraw the 2026-07-20 scope sentence is a Day shift call: #29.Spec
None.
Security
None.
Security review outcome
No unaddressed introduced findings.
Review coverage
No changed file was left unread. Both axes read every file in the review diff, including
package-lock.json. The follow-up commit editspackages/client/src/styles.css,packages/client/src/components/MusicPlayer.tsx,packages/client/tests/music-player.test.ts, andpackages/server/src/client-assets.ts, which were already on both files-read lists.styles.csswas supporting context at review time; the follow-up only deletes the unused.spotify-embed,.music-button.playing, and.music-button:disabledrules the Standards review named.Closes #27
Built with grok · grok-4.7 · xhigh