Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9398d7a80c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| } satisfies Teams["Service"]; | ||
| }); | ||
| export const layer = Layer.effect(Teams, make); |
There was a problem hiding this comment.
Keep team operations as a module until a second consumer exists
The new service and layer have only one production consumer: TeamsPage.handle. Repository-wide search finds that AuthPages only provides the layer; the remaining consumers are tests. The authoritative Effect service review spec explicitly prohibits introducing a service or layer before a second consumer exists. Keep these operations in an ordinary Companies-owned module until the planned audience consumers actually land, avoiding the additional service construction and route-level provisioning in this change.
AGENTS.md reference: AGENTS.md:L97-L97
Useful? React with 👍 / 👎.
|
Review of #1356 (teams). Allison's review, posted by Fermy (his agent). Line numbers are at The tables are right: teams, members (with composite foreign keys) and change history. Edits serialize under the company lock, and no-op edits don't advance anything. What needs work is the module's shape and a few edge cases. Stack-wide
This PR
Tests
|
# Conflicts: # packages/auth/src/CompanyPage.test.ts # packages/companies/src/migrations.ts
…at/1285-durable-teams
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7b29b7d7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| target.role !== "super_admin" && | ||
| (actor.role === "super_admin" || | ||
| (actor.role === "admin" && (target.role === "member" || actor.id === target.id))); |
There was a problem hiding this comment.
Allow super admins to leave teams they have joined
When a super admin joins a team, this predicate prevents anyone—including that person or another super admin—from removing their membership. setMemberships permits the addition but rejects its reversal, and the roster hides the Remove control using the same predicate. The only workaround is to demote the person first, which is unavailable for the company's sole active super admin. Allow an authorized super admin to remove these memberships without changing company roles. This also restores the documented ability to manage their own team memberships.
AGENTS.md reference: AGENTS.md:L80-L80
Useful? React with 👍 / 👎.
|
Superseded by #1416 (the rollback bridge) and #1417 (teams), which carry this work forward under Allison's decisions on #1192 (#1192 (comment)). Closing without merging; Srikar is co-author there. Posted by Fermy (Allison's agent). |
What changed
Adds durable company teams, memberships, and attributable history. Admins can create and rename teams and edit memberships; ordinary members remain read-only.
Addresses Allison’s review with one Teams Effect service, batch membership reads, removal of inactive people, and one directory revision/wake per effective batch. Individual history remains; the unused changes reader is deferred to #1291. Admin-removal restrictions remain intact.
Closes #1285
Look at
Teams.test.tscovers atomic failure, duplicate/no-op batches, one revision per batch, individual attribution, inactive removal and current authority. The PostgreSQL-only concurrency/NOTIFY tests were removed.How it was verified
39 focused tests passed across Teams, CompanyPage and scenario loading. The Companies package and test-program Effect typechecks passed using the installed checker directly. Full
pnpm verifywas not completed: local pnpm is 11.5.0 while the checkout requires 12.9.1.The existing fixes at c7b29b7 are now integrated into assembled #1379 at 0e01b1c, preserving later permissions, lifecycle work and migration IDs 36–41. All 24 workspace typecheck tasks and 74 focused integration tests pass there. Complete-stack broad verification remains non-green, and Srikar is running the Brightline journey. This is not ready-to-merge evidence for the full feature.
Release impact
Part of the one-way roles/audiences stack; land together after stack verification.
Model: GPT-6.1 Codex; harness: Codex.