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: 46de6bfd21
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2adcee5f2
ℹ️ 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".
|
The design review found three avoidable sources of complexity. Srikar has approved fixing them in this PR:
The remaining CI failures are a packed CLI assertion missing the new audience field and another cache concurrency test whose synchronization precedes the new admission reads. I will preserve the strict concurrency assertions and correct the synchronization. The new review finding about showing a public confirmation for a team selection will be fixed too. No new router or policy framework is needed. |
|
Review of #1357 (audiences and sharing). Allison's review, posted by Fermy (his agent). Line numbers are at The decision lives in the right place, and these parts hold:
The data model needs reworking before the rest of the stack builds on it. Waiting on Allison
Stack-wide
This PR
Tests
|
|
Allison's decisions on B and D (all four on #1192). Posted by Fermy (his agent).
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61da8e8ff2
ℹ️ 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".
| if ( | ||
| served.value.patch.companyId === admission.company.id && | ||
| !(yield* Audiences.forAuthenticatedMember(admission.company.id, admission.user.id, [ | ||
| served.value.patch.audience | ||
| ]).pipe( |
There was a problem hiding this comment.
Enforce team audiences at the runtime admission boundary
For a company member outside the selected teams, this check blocks page and content requests but leaves runtime calls and streams accessible. In the inspected production wiring, packages/patches/src/LoadedVersions.ts maps team-scoped patches to scope: "company" without carrying their audience, and packages/runtime/src/GrantedGuests.ts:36–41 admits any same-company viewer without checking teams; both RuntimeProduction and StreamAdmission use that predicate. Consequently, a viewer who keeps an already-open document after membership removal can continue reading data and invoking handlers despite receiving 404 on reload. Apply the current audience predicate to runtime admission and stream reauthorization as well.
Useful? React with 👍 / 👎.
| teamIds: [ | ||
| ...new Set([ | ||
| ...chosen.members.teamIds, | ||
| ...row.audience.members.teamIds.filter((id) => !visible.has(id)) | ||
| ]) |
There was a problem hiding this comment.
Validate the merged team count before persisting it
When a patch already includes 100 teams, a member can submit an otherwise valid selection that retains their own team and adds another while this merge restores the existing teams outside their memberships, producing 101 IDs. Audiences.validate checks team eligibility and owner inclusion but not the count, so saveAudience commits that result even though PatchAudience rejects more than 100 IDs. Subsequent PatchRow decoding then defects, breaking serving, discovery and the normal sharing-repair path. Validate the effective audience after merging, or remove the cap from the persisted schema.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed85a60a66
ℹ️ 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".
| const audience = | ||
| input.audience ?? | ||
| (existing !== null && |
There was a problem hiding this comment.
Preserve hidden team grants during explicit-audience republishes
When an admin adds a team the ordinary-member owner does not belong to, republishing with an explicit team audience containing only the owner's teams silently removes that admin-added grant. record takes input.audience unchanged, validation accepts the removal, and saveAudience replaces all existing team rows. This bypasses the hidden-team preservation implemented in setSharing and promised in docs/product.md. Apply the same preservation policy to publish updates before validating and saving the effective audience.
Useful? React with 👍 / 👎.
| for (const row of changed) | ||
| yield* recordGuestChange(row.patch_id, input.actorId ?? input.userId); |
There was a problem hiding this comment.
Lock patches before grants during company-wide revocation
When company-wide removal overlaps an individual removal for the same guest and patch, these operations can now deadlock: revokeAll locks the grant row first and then recordGuestChange requests the patch row, whereas remove calls patches.manage to lock the patch before updating the grant. Each transaction can therefore hold the row the other needs, causing PostgreSQL to abort one removal instead of completing it. Acquire the affected patch locks in a stable order before updating the grants so both paths follow the same lock order.
Useful? React with 👍 / 👎.
| name: guestName, | ||
| email, | ||
| companyName, | ||
| patches: oversight || visible === undefined || visible.has(row.patchName) ? [patch] : [] |
There was a problem hiding this comment.
Retain restricted grant counts for removal confirmations
For a regular admin outside a patch's selected teams, this filter removes the grant from guest.patches entirely. CompanyPage.renderGuestRemoval then uses that filtered array for both the affected-patch list and the button's count, so a guest whose grants are all restricted gets a “Remove from 0 patches” confirmation. Submitting it nevertheless calls revokeAll, which revokes every grant in the company, including the omitted ones. Preserve the total affected count separately from visible patch details, and explicitly disclose restricted grants in the confirmation without revealing their titles.
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). |
Review reconciliation — 2026-11-11
Restricted guest titles are now filtered by content admission even for management-only super admins. Bounded grant metadata/counts remain available for oversight; removal confirmations render a restricted placeholder without disclosing the title.
Included in assembled #1379 at
0e01b1c3. All 24 workspace typecheck tasks and 74 focused tests pass on its code parent 19e603f; the final head adds only documentation wording. Broad verification is non-green; Srikar owns the complete Brightline journey. This does not establish full-feature readiness.What changed
Patches can be published and shared with Company, selected teams or eligible Public, with independent named guest grants. First publication defaults to Company unless another audience is supplied; updates retain their audience.
Addresses Allison's #1357 review and later #1192 decisions. Scope and team-grant rows are authoritative; duplicate JSON, the company guest pool, all-guests selection and the activation switch are removed. Sharing preserves guests and hidden existing teams, legacy Company flags preserve team restrictions, removed owners receive a recovery refusal, and authorized sharing repairs work for deactivated owners. Guest details and source states respect the viewer's access; audit records name the actor.
Closes #1286. Stacked on #1356. The complete access stack lands together after #1291's checks; do not merge or deploy this PR independently.
Look at
The audience tests exercise actual Companies memberships and named grants. API tests distinguish
owner_access_lostfrom an outsider's 404 and check stable audience refusal codes. Migration coverage preserves revoked and inactive grants, including retired/deleted patches and one guest on multiple patches. Existing serving checks cover direct, alias, historical and raw URLs.How it was verified
pnpm checkwas attempted. The broad local run has platform/tooling failures; repo snapshot and CLI failures reproduce on starting commit74954242. Linux supervisor cases try to read/procon this Mac. No full verification or acceptance pass is claimed.Release impact
Breaking — requires action from anyone already running this
Not breaking — no action required
What does a revert leave behind? The assembled stack writes team scopes and super-admin roles. Existing Company/Public patches and named guest grants retain their meaning.
Does the release before it still work with that? No. The complete stack is one-way; the previous release cannot interpret its new roles and team scopes. Land only after feat(teams): complete team lifecycle and feature acceptance #1291's full journey and rollback checks.
Changes made with GPT-6 in the Codex harness.