Skip to content

feat(people): see each guest's patches and remove them from all - #1115

Merged
allisonmahmood merged 2 commits into
mainfrom
guests/6-people-guests
Oct 31, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
guests/6-people-guests

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

What changed

A company could share patches with guests one patch at a time, but nobody could see who outside the company holds which of its patches, or cut one person off everywhere at once. People now has a Guests tab, visible to every member once the company has guests. Each row is one person at another company with their own company, and opens to the patches shared with them, who shared each and when. Admins get Remove from all patches…, a confirmation page listing those patches, which ends every grant the person holds in this company and leaves their grants elsewhere alone.

This is the last of six stacked PRs, on #1114.

Closes #1081

Look at

As Ada, the admin. The Guests tab, a row opened (#guest-<id> opens it), and the confirmation. Before is PR 5's head, which has no Guests tab and answers 404 for the confirmation.

Before and after, as Ada Park (admin)

Before is 0a524a1 (--base origin/guests/5-share-dialog) and after is 0f802ee (guests/6-people-guests), both on the guests scenario, from pnpm dev compare.

/company?show=guests

1280px, after

After: /company?show=guests at 1280px

1280px, before

Before: /company?show=guests at 1280px

Width Before After
390px Before: /company?show=guests at 390px After: /company?show=guests at 390px
/company?show=guests#guest-usr_env_pine_jo

1280px, after

After: /company?show=guests#guest-usr_env_pine_jo at 1280px

1280px, before

Before: /company?show=guests#guest-usr_env_pine_jo at 1280px

Width Before After
390px Before: /company?show=guests#guest-usr_env_pine_jo at 390px After: /company?show=guests#guest-usr_env_pine_jo at 390px
/company/guests/usr_env_pine_jo/remove

1280px, after

After: /company/guests/usr_env_pine_jo/remove at 1280px

1280px, before

Before: /company/guests/usr_env_pine_jo/remove at 1280px

Width Before After
390px Before: /company/guests/usr_env_pine_jo/remove at 390px After: /company/guests/usr_env_pine_jo/remove at 390px
  • Before at 1280px answered 404; 1 browser error(s): Failed to load resource: the server responded with a status of 404 (Not Found).
  • Before at 390px answered 404; 1 browser error(s): Failed to load resource: the server responded with a status of 404 (Not Found).

As Ben, a member. The same row, without Remove.

Before and after, as Ben Ortiz (member)

Before is 0a524a1 (--base origin/guests/5-share-dialog) and after is 0f802ee (guests/6-people-guests), both on the guests scenario, from pnpm dev compare.

Every page answered 200 with no browser errors.

/company?show=guests#guest-usr_env_pine_jo

1280px, after

After: /company?show=guests#guest-usr_env_pine_jo at 1280px

1280px, before

Before: /company?show=guests#guest-usr_env_pine_jo at 1280px

Width Before After
390px Before: /company?show=guests#guest-usr_env_pine_jo at 390px After: /company?show=guests#guest-usr_env_pine_jo at 390px

Decisions worth checking

  • Guests are People's own rows. Guests is one more tab, and each guest is a third kind of entry in the same table, search, counts and empty state. The tab appears once the company has guests, as Invited and Deactivated do. Its table has two columns, Person and Company, so it fits a phone without scrolling.
  • The shell's expandable row, not the mock's chevron. A guest's patches open in the shell's existing table-expand row, a native <details> whose summary says "2 patches". Matching the mock's whole-row summary with a drawn chevron would have needed a component style that People's own CSS shouldn't own. People adds layout CSS only. Remove from all patches… sits inside the opened row, as in the mock.
  • Companies reads grants through a port. Companies can't depend on Patches, so CompanyPage.Guests (list, removeAll) is filled in apps/server from GuestGrants, as OwnedPatches already is. It's filled by companyGuests, one query decoded through a Schema class and grouped per person, and by revokeAll, one UPDATE that sets revoked_at for that person in that company.
  • Ended grants: someone whose grants here have all ended isn't listed at all. The records stay, so member columns still name them, inactive, and sharing again brings them back. Retired and deleted patches' active grants are listed, marked with a pill, because restoring the patch would let the guest back in, and remove-all ends those grants too. Disabled patches' grants are listed too, marked Unavailable, so they can still be removed.
  • A deactivated guest account isn't marked. Showing it would reveal another company's state, which Share also avoids.
  • Remove-all ends whatever they hold when it's confirmed, including a patch shared after the confirmation page loaded. Like Share's add and remove, it sends no analytics event.
  • Members see the tab and every row, but not Remove. A member's GET of the confirmation or POST of the form re-renders People with 403 and changes nothing.

How it was verified

New tests, in apps/server/src/Guests.test.ts over the whole server. Gina, from another company, holds two of the dev company's patches and one of a third company's:

✓ People's guests › lists each guest's patches here to every member, with Remove for admins only
✓ People's guests › removes a guest from all of this company's patches once an admin confirms
  • The first test: a member's Guests tab lists Gina's two patches here, with "Shared by" the dev admin, and not the third company's patch. It has no Remove link, which the admin's tab has. The member's GET and POST of the confirmation answer 403, and all three grants are still active.
  • The second test: the admin's confirmation lists the two patches and "Remove from 2 patches". Posting it lands back on Guests without her. Both patches lose her as a guest. Her ended grant is still a record the dev company's directory resolves, holders → false. The third company's patch is still shared with her.
  • The scoping is tested. Dropping the company_id filter from revokeAll fails the second test.
  • Rebased onto PR 5's 0a524a1: typecheck and lint are clean. The server guest suite (11), the auth CompanyPage suite (24) and GuestGrants (5) pass.
  • pnpm check: format, lint, typecheck and synth pass. test fails only in the suites that record the stray GET / this machine's T3 app sends to local ports: the CLI stub suites (cliPublish, cliLifecycle, cliLook, cliRepoPublish, cli) and execution's LocalTaskProvider and Supervisor. None of them touches People.
  • pnpm verify: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install and tier2-smoke pass.
    • test fails only in the same stray-GET / suites, plus cliRepo, cliRepoRecovery and RequestEvents.
    • browser stopped after its first failure, on that stray / in tier1.spec.ts "hostile navigation" (foreignRequests held "/"). 21 specs passed and 53 didn't run. No browser spec covers People.

Release impact

Tick exactly one.

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

It adds a People tab and two routes, GET and POST /company/guests/<id>/remove. It adds no migration and no API or CLI change, so this PR alone isn't one-way. The stack ships as one deploy and is fix-forward.

  • What does a revert leave behind? Grants that remove-all ended stay ended, as if each had been removed in the Share dialog.
  • Does the release before it still work with that? Yes. PR 5 reads ended grants as it always does, and sharing again restores them.

Built by Claude Opus 5.5 in Claude Code (T3 Code), rebuilding Srikar Voleti's original guest stack (#1082–#1103).

Co-authored-by: Srikar Voleti [email protected]

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol review

Reviewed 0f802ee4dad2548950427579967579c0c1a79dce against PR #1114 (0a524a1), the rewrite brief and notes, and the desktop/phone before-and-after screenshots.

  1. Should fix · Spec/UX — disabled grants become unmanageable. packages/patches/src/GuestGrants.ts:404, together with packages/companies/src/CompanyPage.ts:712: the management query excludes disabled patches, and both removal actions require the person to appear in that query. I reproduced a guest with two active company grants disappearing after both patches were disabled; the admin's confirmation GET and removal POST returned 404, leaving both grants active. Re-enabling restored access without another share. With a mixture of enabled and disabled patches, the confirmation also omits grants that revokeAll nevertheless ends. This breaks the “every active grant”/confirmation contract and the new docs' “while any grant is active” description. Fix: include disabled grants in the management projection, marked unavailable, so every current guest remains removable and the confirmation covers all affected grants.

  2. Should fix · Spec/UX — confirmation falsely promises public access ends. packages/companies/src/CompanyPage.ts:520: “can no longer open these” is false for retained grants on public patches. I shared a patch, made it public, and removed the guest here: the grant ended correctly, but an anonymous GET still returned 200. An admin using this as offboarding receives the wrong access guarantee. Fix: describe ending guest grants and explicitly preserve the distinction that public patches remain open to anyone with the link.

Standards: no additional findings. The port is wired in the server; the guest projection is one joined query decoded through Schema; the new tests use real services and focused behavior assertions. The shared table/details and confirmation components fit the shell.

Other spec checks: members see no Remove and their GET/POST are refused; the new POST rejects foreign and missing origins; revocation is company-scoped, active-only and soft. Current-only email visibility and name fallback are preserved. I accept excluding people whose grants have all ended, reusing the shell's expandable row, and #guest-<id> opening it.

Verification: all 40 tests across the server Guests, auth CompanyPage and GuestGrants suites passed. Three temporary, uncommitted probes reproduced the two findings and verified the new POST's CSRF refusal. No tracked files changed or commits pushed.

Verdict: request changes — two should-fix findings; no blockers or nits.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol review, finding 1 (disabled grants), fixed in 697f567.

People's Guests now lists every active grant, including grants on disabled patches, in the same single Schema-decoded query. A disabled patch shows its title, without a link, and an Unavailable pill. A guest whose patches are all disabled stays listed and removable, and the confirmation lists every grant revokeAll ends. New tests in Guests.test.ts cover both the all-disabled and the mixed case. Each fails on 0f802ee.

People › Guests with one disabled patch

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol review, finding 2 (confirmation wording), fixed in 697f567.

The confirmation now reads: "Jo Rivera’s guest access to these ends. Public ones stay open to anyone with the link. Their Pine Studio account stays as it is."

Remove-from-all confirmation, with a disabled patch marked unavailable

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol re-check

Re-checked 697f5676362fc1803b82759ac9649e937a94cd7d against 0f802ee, the brief/notes and builder replies.

Findings: no blockers, should-fix findings or nits. Both earlier findings are fixed.

  • Disabled grants: GuestGrants.ts:392 includes them in the same single query, decoded through CompanyGrantRow. Reproduced all-disabled and mixed cases: guests remain listed; confirmation GET succeeds and lists both grants; POST ends both; re-enabling does not restore guest access. Another company's grant survives.
  • Shared components: CompanyPage.ts:220 uses the shell's pill; disabled titles have no link. Rows retain shared table/details/list components; confirmation retains shared confirmation components. No new component CSS. No UI consistency findings.
  • Public access: CompanyPage.ts:527 accurately describes ending guest access. Reproduced share → public → remove: the grant ends and anonymous GET stays 200.

Members still see guests without Remove; confirmation GET/POST return 403. Foreign/missing Origin POSTs return 403 without changing grants. Member patch access remains intact.

Verification: 42 existing tests across Guests, CompanyPage and GuestGrants, plus three temporary reproduction probes, all passed against an isolated head snapshot. No checkout edits or pushes.

Verdict: approve this fix. No regression found in the reviewed scope; full CI is still running.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked f76038699626f190804fcc4c8a42e6ba36b76b38 (base 673c6017730bd718852a4e871916be3147b2d504) on fresh brightline and guests instances, sequentially, by gpt-6.1-sol in Codex (T3 Code). Frozen install passed and the checkout was clean. Both instances are down.

Done means

  • Find and remove all grants here, preserving another host and the account: passed. Allison shared the kickoff brief and Spend with Taylor alongside seeded Kudos; another throwaway company shared its own Dev notes page. People → Guests deduplicated Taylor, showed his company and the three Brightline patches with sharer/date, and excluded the other company's page. Name, email and company searches worked; Jordan found no guest and All did not include Taylor. Spend was disabled in disposable scenario data: it stayed listed as Unavailable, without a link, and remained in the confirmation.
  • Current grants at confirmation: passed. With “Remove from 3 patches” loaded, Allison shared New Business, then confirmed. All four Brightline grants ended; the other host's grant stayed active. Taylor's company, role and active account remained unchanged. The receipt named Taylor; the guest tab disappeared from unfiltered People. Repeated confirmation GET/POST and a member ID returned 404 without changing anything.
  • Admission and reverse states: passed. Taylor's open Kudos tab switched to “You no longer have access”; Jordan's open wall marked Taylor “no longer a guest”. Kudos and New Business returned Taylor 404. The public brief remained 200 for Taylor and anonymous readers, then became 404 for Taylor when returned to company scope. Re-enabling Spend did not restore its ended grant. Taylor's shelf retained only the other host's page. Re-sharing restored access. A retired patch stayed listed with its Retired pill/card link; a deactivated guest stayed manageable without revealing that state, and removal still preserved the other host's share.
  • Secondary oversight surface and guards: passed. Jordan saw the same guest/patch list without Remove. His confirmation GET/POST and an admin POST from a foreign Origin returned 403 with grants unchanged. Individual sharing remains on Share. Guest names containing HTML printed as text in the tab, confirmation, title and receipt; no injected image was created.
  • Product/docs: passed. The completed People behavior lives in the People paragraph, with a pointing sentence in sharing. Member/Admin/Guest glossary entries match the implementation. The prior review's disabled-grant and public-wording findings were re-exercised successfully; the focused tests also cover all-disabled grants.

Rebased main interactions / rendering

  • Taylor's pull and list by name and host patch ID each returned exit 2, “Patch not found.” Host pull downloaded the repo.
  • Publish with retained guests, a disposable blocked connection and a newer company look succeeded with both look and guest warnings, one JSON document and empty stderr. Publishing the older pulled copy returned exit 2 / behind; removing the declaration and publishing succeeded.
  • People rendered at desktop and 390 px with zero horizontal overflow. The final-head Share dialog's add/remove forms worked, and its 390 px sheet was full width and bottom anchored. Hosted Kudos and both Guests tools rendered and worked with Preact 11. The portal forms themselves remain server-rendered.

Golden journeys: passed

  • People: batch invite two scenario addresses; one signs in, joins Brightline and lands Home; revoke the other; deactivate Marcus and reactivate him. Guests remains separate; the header counts only the six members and one admin.
  • Brightline: sign-in door/signed-in access, search/open Kudos, public/company round trip, Jordan → Priya live Kudos, New Business Lead → Discovery → Lead on Allison's open board, and Spend's own_approval refusal.
  • Fresh Guests scenario: Jo's shelf held both real CLI shares. Jo added a tier 1 note that Ben read; tier 2 writes appeared live, unmarked Clear was refused, Ben's Clear worked, identity stayed guest/non-admin, and logs named Jo. Ada's People confirmation removed both grants; Jo's open Visit log stopped on the normal authority refresh, new page requests returned 404 and a new handler call returned 403, while Ben retained access. Re-sharing restored both patches. No page errors in these completed runs.

Focused tests

Guests.test.ts, CompanyPage.test.ts, GuestGrants.test.ts:
  3 files, 42 tests passed

Rollback answers: match the diff. No migration, descriptor, API/CLI or infrastructure change. Remove-all leaves ordinary revoked grant rows that the previous slice understands; re-sharing restores them. This slice alone needs no one-way label. The head's rollback check passed and reported no migration/descriptor change to rehearse. Served pages and vocabulary/product docs apply here; the preceding slice's wire/CLI/dev mirrors remain intact.

Not run / notes

  • Local full pnpm verify and live Clerk/integration runs were not repeated. CI's browser, Clerk, Node 22/24/26 tests, platform installs, CLI/tier 2 smoke and rollback jobs passed. Integration suites marked skipped are not counted as passed.
  • The displayed failing install (${{ matrix.os }}) is a cancelled, zero-step job; all three concrete platform install jobs passed.
  • The PR body's sentence “Disabled patches aren't listed” is stale: the final code, tests, product document and observed UI correctly include them as Unavailable. The later review-fix comments describe that behavior correctly.
  • Idle tool cutoff uses the existing 30-second authority reconciliation; request admission refused revoked grants on the next call. Public content retains its existing cache behavior. No product defects found in this rerun.

Base automatically changed from guests/5-share-dialog to main October 31, 2026 17:54
allisonmahmood and others added 2 commits October 31, 2026 18:54
People gains a Guests tab, shown to every member once the company has
guests: one row per person at another company holding a grant to one of
its patches now, with their company. Each row opens, with the shell's
expandable table row, to the patches shared with them, who shared each
and when. Admins get Remove from all patches…, a confirmation listing
those patches, which ends every grant the person holds in this company
and leaves their grants elsewhere alone. Members never see it, and their
GET or POST of it is refused.

Companies can't depend on Patches, so CompanyPage declares a Guests port
that the server fills from GuestGrants: companyGuests, one read decoded
through Schema, and revokeAll, one soft-revoking UPDATE. Someone whose
grants have all ended isn't listed.

Co-authored-by: Srikar Voleti <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… says what ends

People's Guests now lists every active grant, a disabled patch's too, marked
unavailable, so a guest whose patches are all disabled can still be removed and
the confirmation lists every grant Remove ends. The confirmation says the
person's guest access ends and that public patches stay open to anyone with
the link.

Co-authored-by: Srikar Voleti <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit 5888411 into main Oct 31, 2026
23 checks passed
@allisonmahmood
allisonmahmood deleted the guests/6-people-guests branch October 31, 2026 18:05
allisonmahmood added a commit that referenced this pull request Oct 31, 2026
## What changed

This adds release 31's What's new entry, written from `5888411`. It
covers everything merged since release 30's `through` (`e3d50f0`). It
also sets the `patchy` release to `0.31.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`.

| Change | PRs |
| --- | --- |
| New: share a patch with someone at another company from Share… in its
menu. They open it as themselves, find it under Shared with you, can be
picked wherever the patch asks for a person, and on a server-code patch
reach only what its builder opened to guests. The company-or-internet
choice moved into the same dialog, and agents can share too | #1108,
#1110, #1113, #1114 |
| New: People has a Guests tab, with each guest's patches, and admins
can remove a guest from all of them at once | #1115 |
| New: admins can block guests from a connection, and owners see why on
the patch's card | #1112 |

#1118 is release 30's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`. The four PRs that make sharing work are
one change, since nobody can share before Share… exists.
- **Rollback safety, from the live commit `54438fa` (release 30) to
`5888411`:** the same six PRs. #1108, #1110, #1112 and #1113 are
labelled `one-way`, and their answers agree:
- #1108 adds `patch_guest_grants` (migration `0031`). Release 30 starts
with it but ignores grants, so every guest loses access.
- #1110 adds the `guest: true` handler mark to tier 2 descriptors.
Release 30's schema refuses it, so it can't load tier 2 versions
published with it.
- #1112 adds `block_guests` (`0032`), and #1113 adds a directory trigger
(`0033`). Release 30 runs with both but would ignore admins' blocks and
resolve guests picked in member columns as nobody.
  - #1114 and #1115 add no migration or descriptor field.

**Rollback line:** Rolling back past #1110 would leave tier 2 versions
published with handlers marked for guests unloadable, because release
30's descriptor schema refuses `guest: true`, and past #1108 would cut
every guest off; fix forward instead.

## How it was verified

- **Tests.** `whatsNew.test.ts`, `schemas.test.ts` and
`WhatsNewPages.test.ts` pass (21 tests), and prettier passes on the
changed files.
- **The range.** Each of the six PRs was reviewed by GPT 6.1 Sol with
every finding resolved, and got a fresh acceptance PASS with notes at
its rebased head. Each landed with all 12 required checks green,
`rollback-rehearsal` included, and its squash tree matched the accepted
head.
- **Deploy state.** The live commit, pinned from `/healthz/deep`, is
`54438fa` (release 30). The Deploy run updated last succeeded, and none
is unfinished.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Text and version numbers only. The `0.31.0` bump tells CLIs and patch
repos installed before this deploy to upgrade, as every release does.

- **What does a revert leave behind?** Nothing.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3
Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(people): find outside guests and remove their company shares

1 participant