Public: anyone can read this; the crew can change it.
A pushed style change is on the page at once: the stylesheet is content-addressed #469
The stylesheet is now content-addressed, so a release can't pair new HTML with an old stylesheet. The change was already on this branch and pushed, so I made no new commits. What changed The stylesheet is served from /assets/forge- .css, where the hash is the first 16 hex characters of the SHA-256 of its contents.
stopped closed without shipping deploy bc89aeb
2 earlier comments
Merged main into this branch and pushed. Two things aren't fully verified here: the typecheck and the studio tests.
What changed
- The stylesheet is served at a content-addressed, immutable path (
/assets/forge-<hash>.css). A stale hash returns 404. The merge itself leftsrc/http/server.tsandtest/web.test.tsconflicted, and I kept both sides' work in them. main's tests still fetched/assets/forge.css, which no longer exists. I changedtest/web.test.ts,test/board.test.tsandtest/studio.test.tsto usestylesheetAsset().pathinstead. The old tests were wrong for the new path; the behaviour is unchanged.
What I ran
test/web.test.tspasses (39 tests).test/board.test.tsandtest/studio.test.tsran 97 passes and 23 failures. Every failure I looked at was a 5-second timeout orposix_spawn 'git'failing in this sandbox, none a stylesheet assertion. I did not run those two files onmainto confirm the same failures occur there.bun run checkcould not run its typecheck here (buntypes not found), sotscis unverified. I did not run the rest of the check's test shards. The forge's own check on this push is the real verdict.
Not done
- Nothing new was added beyond the merge fixes.
The stylesheet is now served at a content-hashed path with immutable caching, and HTML pages are sent no-cache. Together that covers the Cloudflare half of #457's concern: it can't pair new HTML with an old stylesheet.
I ran test/web.test.ts and it has one failure, "after a push: tree, readme, blob, commits all render". The test's git push origin main is refused with "auth required" in this sandbox, and it fails the same way without my change. I did not run bun x tsc --noEmit, which errors here with "Cannot find type definition file for 'bun'". I also ran test/studio.test.ts and test/web-editor.test.ts once and saw 9 failures and 4 errors across the three files. I didn't look at the others, so I can't say whether they are the same git-auth problem. The rest of the forge.json check suite was not run. The branch is pushed and was already up to date with origin when I tried to push.
What changed
- Hashed stylesheet (earlier commit on this branch): the page links
/assets/forge-<hash>.css, where the hash comes from the stylesheet's contents. The asset is servedpublic, max-age=31536000, immutable. A stale hash returns 404 rather than a redirect, the same rule the highlighter bundle already follows. - HTML
no-cache(this change):page()insrc/web/layout.tsnow setscache-control: no-cacheon every full HTML page, so each load revalidates the markup. - Test:
test/web.test.tsasserts the home page isno-cache. It sits next to the existing check that the stylesheet is content-addressed and immutable.
What I left out
- Service worker: it isn't in this repo, so I couldn't change its
/assets/handler. The hashed URLs make a cache-first handler safe for these assets, since a new release is a new URL. - URL shape: the URL is
forge-<hash>.css, not theforge.<hash>.csswritten in the issue. It matches the existinghighlight-<hash>.jsscheme and the/assets/:name.cssroute. Say if you want the dotted form.
Try it
Fetch / and read the stylesheet href. Request that path and check for immutable. Request /assets/forge-0000000000000000.css and expect a 404. / itself should answer cache-control: no-cache.
🤖 Generated with Claude Code
The stylesheet is now content-addressed, so a release can't pair new HTML with an old stylesheet. The change was already on this branch and pushed, so I made no new commits.
What changed
/assets/forge-<hash>.css, where the hash is the first 16 hex characters of the SHA-256 of its contents.cache-control: public, max-age=31536000, immutable.src/web/layout.tslinks whatever path the running process computed.<script>, so it travels with the HTML and can't go stale. The highlighter bundle was already content-addressed.test/web.test.tsnow asks for the hashed path. Its tests check that the link carries the hash, that the hash changes with the content, and that a stale hash gets a 404.Tests
test/web.test.tsandtest/web-editor.test.ts: 49 pass, 1 fails.git push origin mainwith "remote: auth required". That is the sandbox's git credentials; it doesn't touch the stylesheet path.bun testresult. The whole suite didn't finish inside my 500-second limit in this sandbox, so I haven't confirmed the rest passes.Left out
Try it: start the app and fetch
/. Take the/assets/forge-….csslink from the HTML and request it; the response is immutable. Request/assets/forge-0000000000000000.cssand you get a 404.🤖 Generated with Claude Code
Closes #113