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. |
|
Review of #1355 (roles). Allison's review, posted by Fermy (his agent). Line numbers are at The authority core is right:
Two things must change before landing: the storage encoding and the CLI wire format. Stack-wide
This PR
Tests
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 023bbe8669
ℹ️ 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".
| `UPDATE users SET role = 'super_admin' WHERE role = 'admin'`, | ||
| `UPDATE invites SET role = 'super_admin' WHERE role = 'admin'` |
There was a problem hiding this comment.
Preserve role storage compatibility during rolling deployments
During a production rollout, these updates make existing administrators unreadable by the previous server revision while it is still serving requests. The inspected apps/infra/src/AppStack.ts configures two hosts with minHealthyPercent: 100, so old and new revisions overlap, and apps/server/src/Server.ts runs migrations at startup. The previous revision's Users.Role and API Identity schemas accept only member and admin; its session and machine-token readers turn decoding failures into defects. Consequently, administrator browser and CLI requests reaching old hosts fail after this migration commits, and rolling back leaves the same failures because migrations are not reversed. Preserve backward-compatible persisted roles, or ship compatible readers in an earlier release before writing super_admin.
Useful? React with 👍 / 👎.
|
Addressed Allison’s #1355 review in the existing PR (latest head
Validation: 207 focused tests passed; 24 People-page tests, 8 wire tests, 20 server/scenario tests and 27 CLI tests passed in their subsequent runs. The combined stack passed 193 focused tests and full typecheck. Full All dependent PR branches were updated by merges, retaining their prior heads. Combined The PR is marked |
|
Fixed the rollback-check mismatch in the existing #1355 at The required Typechecking, targeted lint and workflow-routing checks for both label states passed. Real CI on the new head is queued: https://github.com/allisonmahmood/patchy-cloud/actions/runs/42746963664 . The previously reported install/Pidgeon statuses were queued jobs, not test failures. Propagated through the dependent branches with merges and applied the stack's already-agreed |
|
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
Split company powers into super admin, admin and member using the settled #1192 matrix. Only super admins change roles, manage administrator accounts, administer connections and switch company MCP access. Regular admins retain ordinary-member lifecycle, invitations, company look and guest removal. The last active super admin remains protected under concurrent changes.
Closes #1284. Base of the #1192 stack; land together, never independently.
Look at
Allison's review is addressed: roles are stored directly, existing admins and administrator invitations migrate to
super_admin, and the compatibility flags, helpers and triggers are removed./api/meretainsmember|adminfor installed CLIs and addssuperAdmin; server authorization retains the full role. New CLI text uses the flag.Invitation checks lock the actor's user row
FOR SHARErather than the company row. Concurrent demotion/deactivation still serializes on that user; slow mail no longer holds the company lock. Exported invite revocation checks its actor too. Repeated role labels and duplicate route tests were simplified.How it was verified
pnpm verifywas attempted but is not green: execution/fleet, CLI/build and timeout failures remain; the repeated Bun phase was stopped. Latest CI and combined-branch checks are tracked in feat(auth): separate super admin and admin powers #1284; this is not a ready-to-merge claim.one-wayPRs; reversible PRs retain the full rollback journey. Both workflow routes, script typechecking and targeted lint passed. The real upgrade rehearsal onb3f0fd02is pending CI.Release impact
This stack changes stored roles and must ship together. Installed CLI identity decoding remains compatible.
super_adminrows.super_admin; rollback past this stack requires a separately reviewed data/access migration. Markedone-way, superseding the earlier compatibility-rehearsal claim. Migration 0036 still needs coordination with unmerged feat(auth): people accept updated terms on their next page #1204 in landing order.Model: GPT-6. Harness: Codex.