Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
…onents Design 255 (#888): a route reaches a module's components through components/ only, and these two were the components outside it. Granted by the owner on 2026-11-20: eslint.config.js' primitiveExemptions entry for google-button.tsx follows it, path prefix only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
…scope Design 255 (#888). Eight modules get a client.ts beside index.ts that re-exports the client-side helpers their routes import (search schemas, gates, redirects, hooks), and the routes import it instead of the files. The server code routes call only inside server.handlers goes through a door: account/data, closet, email, feed/entries and feed/public-web each export one or two more names. runs follows once its move (#887) lands. auth's Better Auth browser client moves from auth/client.ts to auth/auth-client.ts, so the door can take the name. New rule, granted by the owner on 2026-11-20: client-side-reaches-no-server. From every client.ts and every components/ folder, nothing reachable may be in env, lib/sql, db, drizzle-orm or cloudflare:. 0 violations; planted ones in a client.ts and a component are refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
Design 255 (#888): now that routes have client.ts, a route's import past a module's doors counts toward past the door (budget 0), as anyone else's does. A module's client.ts is a door, and its width is counted under feed/client.ts. A file in a components/ folder is not past the door, whatever its extension, matching routes-enter-through-doors. Until runs' routes go through its doors (after #887), runs reads 10 here; this branch lands only with that rewrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
…notes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
…ur doors runs gets its client.ts (inputs.ts' search schemas, not-found.ts' gates). The Strava webhook and connect routes reach webhook.ts and oauth.ts through runs/strava's door, since webhook.ts imports node:crypto. routes-enter-through-doors refuses any other route import into a module: functions.ts, components/, client.ts or an index.ts only. ops' defaultCardResponse leaves ops/client.ts for ops/public-web's door: its .woff.bin font imports fail the client build. The new client.ts files join their mutation scopes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML
This branch has not been deployed
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
Design 255 (
docs/designs/255-client-door.md, ruled on by the owner 2026-11-20). Each module whose helpers routes import gets a second, client-safe door,client.ts, and two dependency-cruiser rules hold the line at commit instead of after a build.client.tsdoors (account, auth, closet, feed, notifications, onboarding, ops, runs, safety). Each re-exports what a route uses at module scope: search schemas, gates, redirects and hooks. The helpers stay where they live.client-side-reaches-no-server: from everyclient.tsand everycomponents/folder, nothing reachable insrc/env/,src/lib/sql/,src/db/,drizzle-ormorcloudflare:.routes-enter-through-doors: a route reaches a module only throughfunctions.ts, acomponents/file,client.tsor a door (index.ts, the module's or a sub-module's).server.handlers, which Start strips. That covers the photo, export, unsubscribe and public-kit responses,runs/strava's webhook and connect redirect, andops' default OG card. Doors gain those names.client.tscounts toward door width.auth/client.ts(Better Auth's browser client) is nowauth/auth-client.ts, so the door can take the name.auth/auth-page.tsxandauth/google-button.tsxmove intoauth/components/..claude/rules/routes.mdgains "How a route reaches a module", and design 255 gains "What the build found".About 50 route import paths change; no behaviour changes.
Grants (owner, 2026-11-20, #888)
.dependency-cruiser.cjs: the two rules above.eslint.config.js: theprimitiveExemptionskey for the Google button is re-keyed to its new path underauth/components/, with the same exemption (pills).What the build found
runs/strava/webhook.tsimportsnode:crypto, so it is server-route code and goes throughruns/strava's door.ops'defaultCardResponsereaches noenv, so the reachability rule let it intoops/client.ts. But it imports the card fonts as.woff.bin, andnpm run buildfailed on that. It goes throughops/public-web's door instead.check:bundleand the build stay the check for anything the client build cannot load.Testing
runs/not-found.tsdirectly failsroutes-enter-through-doors;runs/client.tsre-exporting fromenvfailsclient-side-reaches-no-server, naming thelib/sqlandenvfiles it reaches;client.ts, a door, a component orfunctions.tspass (the whole tree, 0 violations).test/scripts/module-shape.test.ts: new tests: a route's import of a file that is no door counts; a module'sclient.tscounts as a door of its own; aclient.tsdeeper than a module's folder is a plain file; neitherclient.tsnor acomponents/helper counts as past the door.test/architecture/mutation-config.test.ts: the newclient.tsfiles join theirstryker.conf.jsonscopes.npm run lint,npm run typecheck,npm testandnpm run diagrams:checkpass.npm run buildpasses:check:bundleis clean, with the entry chunk at 275,668 of 280,000 bytes.npm run e2e:ciandsanctions-checkpass locally.No demo: nothing a user sees changes. No diagram changes (
diagrams:generateredrew nothing, anddiagrams:stalelists no story).The mutation shards may run cold:
stryker.conf.jsonchanges, and the moves touch files across most modules.Closes #888
🤖 Generated with Claude Code
https://claude.ai/code/session_01GFN3djXF7GKhGZYopfh9ML