CedarCopilot wants to merge 1 commit into main from staging
Live on prod, 1 of 6 surfaces working, 2 days left
unknown
unknown
unknown
unknown
unknown
unknown
Libra measured 1 of 6 production surfaces on prod. 3 surfaces had under 20 requests, so Libra has not judged them; 2 surfaces had no requests at all. Libra attributed 6 failures to this change at medium confidence and is still confirming them. Libra checks hourly for 3 days after each deploy.
Not safe to merge: the reproduced authorization, onboarding, and team-management failures can affect users, and the repository requirement around the type assertion must be met before merging.
### Issue 1
apps/server/src/services/agents/share.ts:217-224
The email-invite path creates an invitation without checking whether the caller may share the agent document. An editor without share access can invite an arbitrary external email address; after that person verifies their account, the invitation is converted into a live document grant. Apply the same share authorization and role ceiling used for existing recipients before saving an email invitation.
**How this was verified:** An editor-only caller successfully created an email invitation that later bound to a document grant.
### Issue 2
apps/mail/modules/onboarding/setup/SetupFlow.tsx:155-165
Finishing setup starts the settings, core-onboarding, and account-context writes, then immediately calls `onDone()`. If the optimistic `core` completion is rolled back when its write fails, the user has already reached the product and the onboarding gate sends them back to `/onboarding`. Wait for the required completion write before navigating, and keep the user in setup with a retryable error if it fails.
### Issue 3
apps/server/src/services/teams/membership.ts:159-183
The last-manager check reads membership before a separate unlocked delete or role update. Two managers can both see the other manager, pass the check, and complete concurrently, leaving remaining team members with no manager. Protect the check and mutation in one serialized operation so concurrent removals or demotions leave at least one manager.
### Issue 4
apps/mail/modules/onboarding/setup/SetupFlow.tsx:158
The new `as never` assertion suppresses the settings mutation input contract. This violates the repository directive not to use casts to silence TypeScript errors. Correct the validated mutation type so `isOnboarded` type-checks without an assertion; this repository requirement must be satisfied before merging.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This change is not sa
| Surface | Requests | Errors | p95 | Users | Verdict |
|---|---|---|---|---|---|
| db.select | 2432 → 5805 | 4 → 0 (0%) | 953 ms → 51 ms | 0 | Working 5,805 requests since the deploy with 0 errors (4 errors in the 2,432-request baseline before it). p95 51 ms, was 953 ms. |
| model_chunk Conversation Field Updater | 0 → 2 | 0 → 0 (0%) | not measured → 1 ms | 0 | Insufficient traffic 2 requests, under the 20 Libra needs |
| execute_tool update-conversation-fields | 1 → 1 | 0 → 0 (0%) | 1166 ms → 1210 ms | 0 | Insufficient traffic 1 request, under the 20 Libra needs |
| cron-slow-task-queue.pollCedarInputCrawlers | 0 → 1 | 0 → 0 (0%) | not measured → 79 ms | 0 | Insufficient traffic 1 request, under the 20 Libra needs |
| model_step Conversation Field Updater | 0 → 0 | 0 → 0 (0%) | not measured | 0 | No traffic No requests recorded since this deploy. |
| /api/trpc/crm.getConversationFieldDefinitions | 0 → 0 | 0 → 0 (0%) | not measured | 0 | No traffic No requests recorded since this deploy. |