feat(orgs): checkpoint 2 — the URL owns scope 3 months ago
Authored
grim 7/16/2026, 9:44:14 AM /$org and /$org/$repo route tree with 404-for-non-members resolution;
every scoped server fn takes URL-derived (org, repo) behind role middlewares
whose chains are asserted against the classification; org home/analytics/
settings/members/invites/billing-stub screens; invite redemption page;
install confirm + claim screens over the {userId,orgId}-signed state;
org+repo switcher with inline new-org creation and live dither avatars;
SSE stream filtered to membership-visible repos; analytics activity repo-
scoped (fixed a pre-org cross-repo leak); active_repo_id dropped with a
grep-proof; dev personas org-native; runbook + manual test matrix in
ORG-MIGRATION.md. Parent91a4b63
91 files changed
DECISIONS.md +38 −0 ORG-MIGRATION.md +93 −0 apps/api/src/env.ts +5 −0 apps/api/src/routes/stream.ts +40 −2 apps/web/src/components/activity/activity-page.tsx +13 −5 apps/web/src/{routes/analytics.tsx => components/analytics/analytics-page.tsx} +35 −23 apps/web/src/components/arming/arm-callout.tsx +10 −4 apps/web/src/components/arming/backfill-progress.tsx +13
−3
apps/web/src/components/charts/dither-kit/avatar.tsx +212 −0
apps/web/src/components/charts/dither-kit/index.ts +5 −0
apps/web/src/components/charts/dither-stat-card.tsx +6 −5
apps/web/src/components/dev/auto-login-page.tsx +0 −55
apps/web/src/components/home/home-page.tsx +0 −171
apps/web/src/components/layouts/dashboard-topbar.tsx +55 −17
apps/web/src/components/layouts/repo-switcher.tsx +384 −176
apps/web/src/components/moderation/moderation-page.tsx +35 −10
apps/web/src/components/moderation/moderation-queue.tsx +23 −9
apps/web/src/components/onboarding/onboarding-page.tsx +0 −244
apps/web/src/components/organizations/install-setup-page.tsx +260 −0
apps/web/src/components/organizations/invite-page.tsx +141 −0
apps/web/src/components/organizations/no-orgs-page.tsx +127 −0
apps/web/src/components/organizations/org-analytics-page.tsx +88 −0
apps/web/src/components/organizations/org-avatar.tsx +37 −0
apps/web/src/components/organizations/org-billing-page.tsx +23 −0
apps/web/src/components/organizations/org-general-settings-page.tsx +311 −0
apps/web/src/components/organizations/org-home-page.tsx +240 −0
apps/web/src/components/organizations/org-members-page.tsx +412 −0
apps/web/src/components/organizations/org-not-found.tsx +21 −0
apps/web/src/components/organizations/org-settings-layout.tsx +62 −0
apps/web/src/components/rules/rule-card.tsx +5 −1
apps/web/src/components/rules/rules-page.tsx +36 −41
apps/web/src/components/workflows/workflows-page.tsx +21 −22
apps/web/src/lib/activity.functions.ts +7 −7
apps/web/src/lib/activity.query.ts +28 −9
apps/web/src/lib/analytics-activity.functions.ts +12 −5
apps/web/src/lib/analytics-activity.query.ts +10 −5
apps/web/src/lib/arm.functions.ts +44 −49
apps/web/src/lib/auth.functions.ts +19 −14
apps/web/src/lib/dev/personas.ts +6 −6
apps/web/src/lib/moderation-queue.functions.ts +49 −12
apps/web/src/lib/moderation.functions.ts +7 −4
apps/web/src/lib/moderation.query.ts +6 −4
apps/web/src/lib/onboarding.functions.ts +191 −107
apps/web/src/lib/onboarding.query.ts +11 −34
apps/web/src/lib/org.functions.ts +476 −0
apps/web/src/lib/org.query.ts +86 −0
apps/web/src/lib/rules.functions.ts +47 −32
apps/web/src/lib/rules.query.ts +12 −8
apps/web/src/lib/runs.functions.ts +8 −8
apps/web/src/lib/runs.query.ts +6 −5
apps/web/src/lib/server-fn-boundary.test.ts +72 −9
apps/web/src/lib/server-fn-classification.ts +45 −27
apps/web/src/lib/server/active-repo.ts +0 −37
apps/web/src/lib/server/dev/handler.ts +29 −15
apps/web/src/lib/server/install-state.ts +34 −11
apps/web/src/lib/server/org-guard.ts +132 −0
apps/web/src/lib/workflows.functions.ts +38 −24
apps/web/src/routes/{activity.tsx => $org.$repo.activity.tsx} +4 −4
apps/web/src/routes/$org.$repo.analytics.tsx +18 −0
apps/web/src/routes/$org.$repo.index.tsx +11 −0
apps/web/src/routes/$org.$repo.moderation.tsx +18 −0
apps/web/src/routes/{rules.tsx => $org.$repo.rules.tsx} +4 −4
apps/web/src/routes/$org.$repo.tsx +24 −0
apps/web/src/routes/{workflows.tsx => $org.$repo.workflows.tsx} +4 −4
apps/web/src/routes/$org.analytics.tsx +18 −0
apps/web/src/routes/$org.home.tsx +18 −0
apps/web/src/routes/$org.index.tsx +8 −0
apps/web/src/routes/$org.settings.billing.tsx +18 −0
apps/web/src/routes/$org.settings.index.tsx +11 −0
apps/web/src/routes/$org.settings.members.tsx +18 −0
apps/web/src/routes/$org.settings.settings.tsx +18 −0
apps/web/src/routes/$org.settings.tsx +14 −0
apps/web/src/routes/$org.tsx +25 −0
apps/web/src/routes/__root.tsx +9 −8
apps/web/src/routes/dev.auto-login.tsx +0 −17
apps/web/src/routes/index.tsx +30 −7
apps/web/src/routes/invite.$token.tsx +18 −0
apps/web/src/routes/moderation.tsx +0 −17
apps/web/src/routes/onboarding.setup.tsx +22 −19
apps/web/src/routes/onboarding.tsx +0 −18
packages/contracts/src/contracts.test.ts +0 −1
packages/contracts/src/repo.ts +0 −2
packages/db/drizzle/0007_free_retro_girl.sql +3 −0
packages/db/drizzle/meta/0007_snapshot.json +2134 −0
packages/db/drizzle/meta/_journal.json +7 −0
packages/db/src/index.ts +1 −6
packages/db/src/schema/auth.ts +4 −11
packages/db/src/services/insights.ts +10 −3
packages/db/src/services/onboarding.integration.test.ts +0 −258
packages/db/src/services/onboarding.ts +8 −226
packages/db/src/services/organizations.ts +128 −0