Skip to content

Stop remote classic scripts and send script-src 'self' - #28

Merged
JacobStephens2 merged 2 commits into
masterfrom
issue-27
Oct 22, 2026
Merged

JacobStephens2 merged 2 commits into
masterfrom
issue-27

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

GET / and any HTML fallback
  serveClientAssets
    Content-Security-Policy: script-src 'self'
index.html
  no https://analytics.stephens.page/script.js
  no https://analytics.stephens.page/recorder.js
  module script stays /src/main.tsx
MusicProvider
  does not append https://open.spotify.com/embed/iframe-api/v1
  drawer: "The embedded player could not load. Open the recording in Spotify."
  link: https://open.spotify.com/track/5SsgnRkcr4ogLB9rcW61tf

Seams under test:

  • Game document (packages/client/index.html): no classic script from analytics.stephens.page.
  • Llorarás music player (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.
  • Static HTML response (serveClientAssets): an HTML response, including the SPA fallback, sends Content-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

  • Before: packages/client/tests/document.test.ts failed because index.html contained https://analytics.stephens.page/script.js. packages/client/tests/music-player.test.ts failed because the mount appended <script src="https://open.spotify.com/embed/iframe-api/v1">. packages/server/tests/client-assets.test.ts failed because serveClientAssets did 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.ts passed, 5 tests.

The Standards check opens Llorarás as a command, not a pressed toggle or an empty embed well failed on aria-pressed="false", then passed after the drawer lost the empty embed well (1f4e2cb). Playwright offers Llorarás in Spotify when the embedded player is not loaded passed on mobile-chrome and desktop-chrome.

A request for the built packages/client/dist/index.html through serveClientAssets returned 200, text/html; charset=utf-8, and script-src 'self'. The built document's only script is <script type="module" crossorigin src="/assets/index-CIo19HZo.js">. The bundle does not contain analytics.stephens.page or open.spotify.com/embed/iframe-api.

npm test passed 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.js and recorder.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 edits packages/client/src/styles.css, packages/client/src/components/MusicPlayer.tsx, packages/client/tests/music-player.test.ts, and packages/server/src/client-assets.ts, which were already on both files-read lists. styles.css was supporting context at review time; the follow-up only deletes the unused .spotify-embed, .music-button.playing, and .music-button:disabled rules the Standards review named.

Closes #27

Built with grok · grok-4.7 · xhigh

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.
@JacobStephens2
JacobStephens2 merged commit 5e82275 into master Oct 22, 2026
4 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-27 branch October 22, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop remote classic scripts and send script-src 'self'

1 participant