Repository navigation
Tighten Hosted's deploy check, both Relays' asset caching, and two rule wordings - #1345
Merged
Merged
Conversation
- The production preflight requires each Worker to bind exactly one Hyperdrive before it reads any, so no Worker's caching, origin, or role check is skipped, and the distinct-Hyperdrive check counts the bindings themselves. - Only a file whose name carries Vite's content hash is cached as immutable under `/assets/` and `/connect/assets/`; any other file there takes its path's normal policy. - The RelayRoom schedules its next sweep from the current one's start, so a slow row read no longer delays it, and the rule says so. - The workflow audit rule states plainly that an admin's push or branch creation with a lost tip is skipped rather than reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
84788fc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b76fe9ca.mouseterm.pages.dev |
| Branch Preview URL: | https://deploy-preflight-and-rule-wo.mouseterm.pages.dev |
dormouse-bot
approved these changes
Oct 21, 2026
… Relay The self-host Relay marked every file under `/assets/` immutable. It now applies Hosted's rule: only a name carrying Vite's content hash is immutable, and any other file there is revalidated like the rest of Pocket. The hash-name check moves to `isContentHashedName` in remote-lib-common, which both Relays already import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dormouse-bot
approved these changes
Oct 21, 2026
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.
Deploy-check, caching, and spec-wording fixes for Hosted, the self-host Relay, and the workflow audit.
Deploy check (
hosted/scripts/production.mjs)productionConfigsandpreflightnow require every Worker to bind exactly one Hyperdrive, and fail (<name> must bind exactly one Hyperdrive) beforepreflightreads anything. Previously a Worker whose config listed no Hyperdrive passed both, andpreflightnever checked that Worker's caching, migration host/port/database, or role. The "three different Hyperdrives" check now counts the IDs actually bound rather than the three environment variables, sopreflightalso catches two Workers sharing one when handed configs directly. The Hyperdrive variable is now required for every Worker, not only one whose config lists a binding.Asset caching (
hosted/server/headers.ts,relay/src/app.ts)immutablecaching now applies only to names carrying Vite's content hash ([name]-[hash].[ext], 8 base64url characters, checked against the current Pocket, one-time, and account builds). On Hosted that covers/assets/(account and Pocket) and/connect/assets/(one-time page); on the self-host Relay, Pocket's/assets/. Any other file there takes its path's normal policy:no-cacheon Pocket's paths,no-storeon the account and the one-time page. Both Relays use one check,isContentHashedNameinremote-lib-common/src/remote/relay-common.ts.docs/specs/pocket-app.md-> "Serving the built bundle", which owns Pocket's cache classes for both Relays, now says so;relay.mdalready points there. Hosted test fixtures now use realistic 8-character hashes.RelayRoom sweep (
hosted/server/relay-room.ts)The next sweep is now scheduled
RELAY_ROOM_SWEEP_MSafter the current alarm started rather than after the sweep finished, so a slow row read (up toRELAY_ROW_READ_TIMEOUT_MS) no longer delays it. This is a one-line change (the alarm already captured its start time), so it was simpler to fix the code than to reword the rule around the delay. The rule insecurity-hosted.md(S115) now says what the code guarantees: each sweep schedules the next no later than the interval after its own start.Spec wording
docs/specs/security-hosted.md: S122 names each Worker's single Hyperdrive; S115 as above. The word budget is raised to 3150.docs/specs/security-ci.md: S48 now states plainly that an admin'spushorbranch_creationwhose tip is lost is skipped, and the commit's next activity row decides. Any other row with a lost tip is still reported as unexplained. The classifier is unchanged.No files under
.github/change; S48 only describes.github/workflows/workflow-audit.yaml.Tests
hosted/scripts/production.test.mjs: a Worker with no, missing, or two Hyperdrive bindings failsproductionConfigsandpreflightbefore any read. Two Workers bound to one ID failpreflight.relay/test/static.test.mjs: on the self-host Relay,/assets/plain.jsand a 7-character hash areno-cache; real hashed names, including a multi-dash one, stay immutable.remote-lib-common/test/relay-common.test.mjspins the shared check on its own.hosted/server/tests/boundary.test.ts: names without a hash (/assets/plain.js, a 7-character hash,/connect/assets/plain.js) are not immutable on either Worker. A real multi-dash hashed name is.hosted/server/tests/relay-room.test.ts: a sweep stalled on its row read still schedules the next sweep within the interval from its start.Each new assertion fails with its fix reverted. Ran: hosted
vitest run(Docker, 204 pass),pnpm typecheck,node --test hosted/scripts/*.test.mjs,node --test scripts/workflow-audit.test.mjs,remote-lib-commonandrelaypnpm test,pnpm test:checks.🤖 Generated with Claude Code