Rename team → organization, mirror minimally from WorkOS - #130
Merged
RhysSullivan merged 2 commits intoApr 9, 2026
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 539226a | Apr 09 2026, 08:06 PM |
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5 tasks
RhysSullivan
force-pushed
the
04-09-rename_team_organization_mirror_minimally_from_workos
branch
from
April 9, 2026 17:06
bea97fb to
6aad791
Compare
RhysSullivan
marked this pull request as ready for review
April 9, 2026 20:01
Collaborator
Author
Merge activity
|
RhysSullivan
changed the base branch from
04-08-remove_lazy_user_team_provisioning_from_api_request_handler
to
graphite-base/130
April 9, 2026 20:02
Reshape the data model to mirror WorkOS naming and reduce duplication: - `users`/`teams`/`team_members`/`invitations` → `accounts` + `organizations` - `team_id` → `organization_id` everywhere (shared schema, postgres package, cloud) - Drop membership and invitation tables — AuthKit owns these - `accounts` is just the WorkOS user ID (FK anchor); profile data lives in WorkOS - `organizations` mirrors org id + name for fast executor creation Swap auth resolution to proper Effect HttpApi middleware: - `SessionAuth` middleware (cookie security) provides `SessionContext` — used by /auth/me, /auth/logout, /auth/organization - `OrgAuth` middleware provides `AuthContext` (org required) — used by all protected executor endpoints - Three-tier API split: public (login/callback), session (auth ops), protected (org-required executor ops) Wire createOrganization through WorkOS SDK so first-time users can bootstrap their org via the /setup flow.
The pg driver's CloudflareSocket silently hangs when a Client is reused across Workers request contexts, causing /api/scope and other endpoints to never respond after the first request. Switch DbService to postgres.js + drizzle-orm/postgres-js, which creates a fresh socket per Effect scope and aligns with Workers' per-request I/O model.
Also adds:
- Real integration test for DbService running inside the Workers runtime via @cloudflare/vitest-pool-workers, talking to PGlite over a TCP socket. Covers the sequential-scope and nested-scope patterns that hung under pg.
- Local dev PGlite socket server (scripts/dev-db.ts) so dev works without Docker or a Postgres install.
- Auto-create a WorkOS organization on first login.
- Split auth middleware into pure tag + live impl so the client bundle doesn't pull in the WorkOS SDK.
- APP_URL env var for OAuth callback redirect in dev.
- iron-webcrypto patch fixing require('buffer/index.js').
RhysSullivan
force-pushed
the
04-09-rename_team_organization_mirror_minimally_from_workos
branch
from
April 9, 2026 20:03
6aad791 to
539226a
Compare
RhysSullivan
added a commit
that referenced
this pull request
May 31, 2026
Reshape the data model to mirror WorkOS naming and reduce duplication: - `users`/`teams`/`team_members`/`invitations` → `accounts` + `organizations` - `team_id` → `organization_id` everywhere (shared schema, postgres package, cloud) - Drop membership and invitation tables — AuthKit owns these - `accounts` is just the WorkOS user ID (FK anchor); profile data lives in WorkOS - `organizations` mirrors org id + name for fast executor creation Swap auth resolution to proper Effect HttpApi middleware: - `SessionAuth` middleware (cookie security) provides `SessionContext` — used by /auth/me, /auth/logout, /auth/organization - `OrgAuth` middleware provides `AuthContext` (org required) — used by all protected executor endpoints - Three-tier API split: public (login/callback), session (auth ops), protected (org-required executor ops) Wire createOrganization through WorkOS SDK so first-time users can bootstrap their org via the /setup flow.
RhysSullivan
deleted the
04-09-rename_team_organization_mirror_minimally_from_workos
branch
June 11, 2026 08:00
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.

Reshape the data model to mirror WorkOS naming and reduce duplication:
users/teams/team_members/invitations→accounts+organizationsteam_id→organization_ideverywhere (shared schema, postgres package, cloud)accountsis just the WorkOS user ID (FK anchor); profile data lives in WorkOSorganizationsmirrors org id + name for fast executor creationSwap auth resolution to proper Effect HttpApi middleware:
SessionAuthmiddleware (cookie security) providesSessionContext—used by /auth/me, /auth/logout, /auth/organization
OrgAuthmiddleware providesAuthContext(org required) — used by allprotected executor endpoints
protected (org-required executor ops)
Wire createOrganization through WorkOS SDK so first-time users can
bootstrap their org via the /setup flow.