Skip to content

feat(guests): guests can be the person in a member column - #1113

Merged
allisonmahmood merged 3 commits into
mainfrom
guests/4-member-columns
Oct 31, 2026
Merged

allisonmahmood merged 3 commits into
mainfrom
guests/4-member-columns

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

What changed

A guest couldn't be the person in a t.member() column. Assigning them was refused, pickers never offered them and resolution returned null, so a patch like Kudos needed a text-column workaround. Now a patch's member columns and pickers take anyone who can open it: the company's members plus the patch's active guests.

Resolution covers anyone holding one of the company's grants, active or ended, so another patch reading a shared table resolves them too. A guest carries guest: true, is never admin, and shows active: false once their grant is revoked or their account is deactivated. Rows keep their name, and sharing again makes them active. Grant changes advance the company's directory revision, so live pickers update.

Kudos goes back to member columns. The handlers its page needs are marked guest: true, and its people handlers return only what the page shows. Taylor of Cedar Works joins the brightline scenario as the guest to be; the share step comes with PR 5's patchy share.

This is the fourth of six stacked PRs. Sharing has no surface until PR 5, so the tests write grants through GuestGrants.

Closes #1101

Look at

  • guest is present only on guests, not guest: boolean on everyone. This deviates from the plan. The host decodes handler results strictly. A required key on every member broke brightline's Spend immediately: its requests.list returns members through t.object({ id, name, email, admin, active }). It would break every published tier 2 version that does the same. With guest?: true (wire, Directory.Member and the SDK's Member), members are byte-identical to before, the same choice PR 1 made for me().guest. A result schema that passes members through whole fails only once it returns a guest, and the members skill states that fact.
  • Companies never reads grants. Directory takes a Scope { companyId, guests: Map<userId, active> } as plain data. The server's MemberDirectory adapter, which already bridged companies and primitives, fills it from Patches' GuestGrants:
    • pickers and assignment checks use guests(patchId), so they're per patch;
    • resolution uses the new holders(companyId, ids), so it's company-wide.
    • memberOf(scope, row) is the one rule: a guest is never admin, and is active only while both their account and a grant are.
  • Live updates use the existing mechanism. Migration 0033_guest_grants_directory adds a trigger on patch_guest_grants that bumps companies_directory and notifies members:<company>, as the users trigger does. It fires when a grant starts, ends, restarts or goes with its patch. Re-sharing an active grant changes nothing, so it doesn't fire.
  • Members pay almost nothing. Each directory read adds one indexed grants read. With no guests, the users query keeps its old plan, because sql.in over an empty list renders 1=0, which Postgres folds away.

Kudos, with Taylor of Cedar Works shared on it

These come from a local pnpm dev up brightline with Taylor's grant written directly, driven in Chromium.

Taylor, the guest, thanked Priya through the guest-marked give. Every name on the wall resolves for them.

Taylor's kudos on the wall

Allison's picker offers Taylor, marked Guest

The picker no longer shows emails, because its handler doesn't return them.

Allison's picker

No before shots: Kudos is a scenario patch, and on the base every call Taylor made was refused.

How it was verified

New focused tests:

✓ apps/server/src/Guests.test.ts > a tier 2 patch's guest > can be the person in a member column while their grant stands
✓ apps/server/src/Guests.test.ts > a tier 2 patch's guest > is resolved by another of the company's patches, through the table it shares
✓ apps/server/src/Guests.test.ts > a tier 2 patch's guest > joins and leaves a member's live picker as the grant starts and ends
✓ packages/companies/src/Directory.test.ts > company directory > offers and checks a scope's active guests, and resolves every guest in it
✓ packages/patchy/src/devMembers.test.ts > lists the local person, the colleague and the guest by name, searched by name or email prefix
  • The member-column journey runs over the whole server with real workerd:
    • A guest claims a task through a marked mutation, and a member assigns them another.
    • The patch's picker lists and searches them with guest: true and admin: false. Gina is her own company's admin, which makes admin: false meaningful. Another patch's picker doesn't offer them.
    • After a revoke they resolve active: false, and assigning them is invalid_row.
    • After sharing again they're active and assignable.
  • The shared-table test publishes a second patch that reads the first's tasks and resolves its owners with getMany.
  • The live test subscribes a member to the picker query. The guest appears on grant and disappears on revoke. With the trigger disabled it times out, so it tests the trigger.
  • Focused suites:
    • companies Directory, all of primitives, sdk and devMembers pass.
    • So do these apps/server suites: Guests, Members, StreamLifecycle and migrations. Also GuestGrants and the scenario loader: 143 tests.
  • Brightline: pnpm dev up brightline builds and loads all three tier 2 patches. Kudos' generated repo passes its own pnpm typecheck and pnpm lint.
  • pnpm check: format, lint, typecheck and synth pass.
    • The offline tests fail only the suites that record stray GET / requests from this machine: cliPublish, cliLifecycle, cliLook, cliRepo, cliRepoRecovery, RequestEvents and LocalTaskProvider. Their logs show { method: 'GET', url: '/' }.
    • RequestEvents, LocalTaskProvider and devExecution pass when rerun alone.
  • pnpm verify: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install and browser pass.
    • tier2-smoke failed first on this PR: the packed e2e expected the dev directory's two candidates, and the dev guest makes three. Its expectation is updated, and it passes rerun alone.
    • test failed only the stray-request suites above, plus cli.test and LocalTaskProvider.
  • After rebasing onto PR 3's b27c9bb: typecheck and lint pass, and the guest, directory, primitives, serving and migration suites pass (165 tests).
  • docs/API.md is unchanged: render-docs produced no diff.

Release impact

Tick exactly one.

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

Members read exactly as before, since only guests carry guest. The migration adds a trigger and no columns.

  • What does a revert leave behind? The patch_guest_grants_directory_changed trigger (0033_guest_grants_directory). Rows written while it ran may hold guests' ids in member columns.
  • Does the release before it still work with that? It runs, since it never writes grants, so the trigger never fires. But it would resolve those guests as null and refuse them again, and the rest of the guest stack is one-way. One-way: fix forward, with the whole stack shipping as one deploy.

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]

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:primitives Patch tables and files size:xl Over 1,000 changed lines; review in multiple passes labels Oct 31, 2026
@allisonmahmood allisonmahmood added the one-way Rolling production back past this PR would break the release before it label Oct 31, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol review

Reviewed 7a06db9 against guests/3-block-guests (b27c9bb), using the rewrite brief, all four stack notes and the requested standards.

  1. Should fix — Spec: revoking one patch does not make its historical guest inactive. packages/patches/src/GuestGrants.ts:276 aggregates activity with bool_or across every grant in the company, and apps/server/src/MemberDirectory.ts:34 uses that result for every patch's resolution. With grants on A and B, revoking A removes the guest from A's picker and rejects new assignments there, but A's existing rows still resolve active: true. I reproduced this through the real server. That contradicts Allison's rule that removal keeps the name shown inactive; sharing B must not reactivate history in A. Company-wide name resolution for shared tables does not require company-wide activity.
    Fix: retain company-wide historical identity resolution, but carry patch context into resolution and derive guest activity from the applicable patch grant; cover the two-grant/revoke-one case.

  2. Should fix — Spec: cross-patch guest resolution includes contact information. packages/companies/src/Directory.ts:75 copies the guest's real email into the company-wide result. A shared-table reader with no grant for that person receives their email through getMany, including after revoke; the test at apps/server/src/Guests.test.ts:685 explicitly expects it via inDirectory(guest). This exceeds the requested names-only information available through cross-patch resolution. The guest's home admin role and company are correctly withheld.
    Fix: preserve historical names and required display status, but redact guest contact information outside the patch they are shared with, and assert that boundary in the shared-table test.

Standards: no additional findings in the TypeScript/Effect style, package boundary, migration or test structure. Companies receives grant facts rather than reading grants. The trigger changes one company's revision and emits one bounded wake key per changed grant; no-op active shares do not update a row. Fetched origin/main ends at 0030; the stack's 0031, 0032, 0033 are unique and ordered.

Compatibility judgment: guest?: true is the right wire choice. A required boolean would break existing strict member result schemas. An isolated real-server probe returning a member through the old five-field object schema passed. Kudos' people/search results explicitly project out emails and admin flags.

Verification: six focused suites passed, 25 tests. Additional isolated probes confirmed unshared-patch assignment refusal and old-schema compatibility; the two-grant inactivity probe failed as described above. The failed rollback-rehearsal job reports a waiting Deploy run and an uncertain live commit, rather than a code failure. No tracked files changed and no commits pushed.

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

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Fixed both should-fix findings from the Sol review (e5eb486).

  1. Activity per patch. members.get/getMany now take the patch they resolve for. GuestGrants.holders still finds anyone holding one of the company's grants, so shared-table readers get the name. But it reports true only for an active grant on this patch. A guest revoked on A shows inactive in A while B stays shared, and re-sharing B leaves A's history inactive. Members are unchanged.
  2. Email kept to the patch. A guest's email comes back only from a patch they hold an active grant on. Everywhere else (after revoke, or another patch reading a shared table) they resolve by name with guest: true, active: false and an empty email.

Tests: a new two-grant/revoke-one case in Guests.test.ts, which I checked fails on the old bool_or. The shared-table test now asserts no email and inactive. The ended-scope case in Directory.test.ts asserts the empty email. pnpm typecheck and pnpm lint are clean. Focused suites for companies, patches, primitives, runtime (including the postgres config), the server guest/stream suites and the dev directory all pass.

Docs: the members skill, docs/product.md, the Companies glossary, the SDK Member comment, the CLI README and the members.* prose in docs/API.md (re-rendered) now state the per-patch rule.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Sol re-check

Re-checked 7a06db9..e5eb486 against the brief and builder's reply.

Blockers / should fix: none. Both original findings are fixed through the real server/workerd path:

  • packages/patches/src/GuestGrants.ts:280 now determines activity from the requested patch's grant. The two-grant reproduction passes: revoke A while B remains shared, then revoke/re-share B; A remains inactive with its email redacted.
  • packages/companies/src/Directory.ts:77 returns email: "" outside an active grant on this patch. Shared-table getMany retains names and marks guests inactive. No new cross-patch email or home-company disclosure found; guests remain non-admin.

Nit — documentation conflates account activity with email visibility. packages/sdk/skills/patchy-members/SKILL.md:25 and docs/product.md:850 imply email also requires an active account. A real-server probe confirms that a deactivated guest with an unrevoked grant retains their email in that patch (Directory.ts:77), while active is false. Clarify that email requires the patch's active grant; activity additionally requires the account.

Compatibility: keep email: "". It preserves required string fields; omission/null would break existing strict schemas. Old five-field member results still pass unchanged; projected redacted guests pass too. Raw guests still require guest in strict result schemas, as already documented. Builders can use if (member.email) before contact actions.

Verification: seven focused suites, 39 tests, plus an isolated workerd probe passed. Members' resolution, validation and pickers remain unchanged. Added/updated tests are focused. CI's rollback-rehearsal failure reports an uncertain live revision/waiting Deploy, not a code failure.

Verdict: PASS with one documentation nit. No code changed or pushed.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Correction to the acceptance note on a guest's active: that line repeated the builder's notes written before e5eb486. Since e5eb486, a guest's active is per patch. A guest revoked on Kudos shows inactive there even while another of the company's patches is still shared with them. Sol's re-check reproduced the two-grant case through the real server (re-check), and Guests.test.ts covers it.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 4c7387bd56fb619e32be053184991a436021e4fe (base 591c350e0dccd033135ef741519e26bb0711eb13) on fresh brightline, by gpt-6.1-sol in Codex (T3 Code).

Done means

  • Directory-backed Kudos admits a guest: passed. Granted Taylor Morgan of Cedar Works through the domain-table path, since this head has no share surface yet. Taylor opened Kudos with names resolved, thanked Priya, and Priya saw the new Kudos live. Allison selected Taylor in the Guest-marked picker and sent him Kudos, proving a guest can occupy a member column.
  • Deliberate handler boundary: passed. Taylor's marked people.search returned only id, name, active, guest. Unmarked sample.load and direct members.list each returned 403 access_denied.
  • Live candidates and retained history: passed in Chromium. Allison searched Tay before grant and saw no option. Grant added Taylor without retyping; revoke removed him; regrant restored him. Existing wall entries retained his name with “Taylor Morgan (no longer a guest)”.
  • Per-patch activity: passed. With another Brightline grant retained, revoking Kudos still resolved Taylor inactive in Kudos. The previous verdict's company-wide-activity note no longer describes this head: the reviewed fix is present and the two-grant/server test passes.
  • Shared-source/blocked-connection eligibility and historical contact privacy: passed in the focused whole-server/directory suites. Cross-patch historical resolution retains names with empty email and inactive status; assignment of a revoked guest is refused.

Main-feature interaction

  • Guest pull and inspection: passed with both host patch name and host patch id. Taylor's isolated machine credential received “Patch not found” for each; no source was downloaded.
  • Host pull: passed; downloaded a repo copy.
  • Publishing with active guests and a blocked scenario connection: exit 0, empty JSON stderr, actionable guest warning retained.
  • After giving the throwaway repo a generated look import and advancing the scenario company look, successful publish retained both the look warning and guest warning. Kudos normally uses its own styling, so a look warning was not expected until that fixture import was added.
  • The pulled copy, left behind by the newer publish, was refused with exit 2, kind: "rejected", code: "behind". Removing the blocked declaration and publishing worked.

Golden journeys

  • Passed: sign-in door, Home search, public/private sharing, live Kudos across Jordan/Priya, New Business move and reverse across Jordan/Allison, and Spend's strict member-result schema plus own_approval refusal. No browser page errors.

Evidence

Whole-server guests, members, stream lifecycle, migrations,
Directory, GuestGrants, primitives, local dev members:
Test Files  13 passed (13)
Tests       104 passed (104)

Rollback answers: match the diff. Trigger/migration 0033 and guest ids in member columns remain; the older directory would resolve those ids as null. one-way is present. CI's rehearsal passed all four upgrade/rollback/forward steps on its PR merge build.

Not run

  • Share and Shared with you are introduced in feat(sharing): share a patch from its menu #1114, not available at this head.
  • Guest profile changes waking host subscriptions remain the documented next-rerun behavior; no live external services or real Clerk flow were run.
  • Some CI jobs remain pending. The displayed zero-step matrix failure is a cancelled job, confirmed through its job record.

Notes

  • All fixture changes stayed in the throwaway scenario workspace. The local instance was taken down; no PR code, body, branch or labels changed.

Base automatically changed from guests/3-block-guests to main October 31, 2026 17:28
allisonmahmood and others added 3 commits October 31, 2026 18:28
A patch's member columns, pickers and assignment checks cover its company's
members and its active guests. Resolution covers the company's members and
anyone holding one of its grants, so a revoked guest keeps their name,
shown inactive, and another patch reading a shared table resolves them.
Only guests carry `guest: true` on the wire, so members and published
result schemas read as before. Grant changes advance the company's
directory revision (0033), so live pickers update. Kudos goes back to
member columns with guest-marked handlers, and Taylor of Cedar Works joins
the brightline scenario.

Co-authored-by: Srikar Voleti <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mail to it

A guest's activity was any active grant in the company, so revoking one
patch left its history showing them active while another patch stayed
shared, and every patch resolving them got their email.

Resolution now takes the patch it's for. Anyone holding one of the
company's grants still resolves by name, but is active, with their email,
only in a patch whose grant is active; elsewhere they're inactive with an
empty email. Members resolve as before.

Co-authored-by: Srikar Voleti <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A guest's email follows the patch's active grant; `active` also needs
their account. A deactivated guest in a patch still shared with them
keeps their email there but resolves inactive.

Co-authored-by: Srikar Voleti <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the guests/4-member-columns branch from 4c7387b to fa0ef51 Compare October 31, 2026 17:28
@allisonmahmood
allisonmahmood merged commit cf066d6 into main Oct 31, 2026
22 checks passed
@allisonmahmood
allisonmahmood deleted the guests/4-member-columns branch October 31, 2026 17:42
allisonmahmood added a commit that referenced this pull request Oct 31, 2026
## What changed

There was no way to share a patch with someone at another company:
grants existed, but nothing wrote them. Now **Share…** in a patch's
three-dots menu, on All patches rows, Home and the patch's own card,
opens the Share dialog over the page. The owner or an admin adds a guest
by email, sees and removes guests, and picks who can open the patch. The
guest is in at once and finds it under **Shared with you** on their
Home, where they can open it or remove it. Owners' agents do the same
with `patchy share --add`, `--remove` and `--list`.

This is the fifth of six stacked PRs, on #1113.

Closes #1080

## Look at

The flow, on PR 4's head (left, which has no Share…) and this PR's
(right):


https://github.com/user-attachments/assets/4906327c-0de8-46a3-8000-8e502a33ca74

<details><summary>How to read the film</summary>

As Allison, brightline's admin, on All patches: the kickoff brief's
menu, then Share…. An email with no Patchy account is refused under the
field; Taylor, at Cedar Works, is added. Picking Anyone on the internet
asks in the dialog, and Make public applies it.

</details>

**The dialog, desktop.** It reuses the Final step's modal panel, and on
a phone it's a bottom sheet.

| Opened | Refused | With a guest, tier 2 |
| --- | --- | --- |
| ![Share dialog,
empty](https://github.com/user-attachments/assets/009b1dcc-03ca-4ede-8f7e-55a3ec27fe86)
| ![Share dialog with a refusal under the
field](https://github.com/user-attachments/assets/5c5cab34-70a0-4a66-add6-45a339b8387c)
| ![Kudos shared with Taylor; Anyone on the internet is disabled for
tier
2](https://github.com/user-attachments/assets/073973de-c84e-4c30-aac0-70f58a6eb399)
|

| Going public | Public |
| --- | --- |
| ![Make public, confirmed in the
dialog](https://github.com/user-attachments/assets/45f29cc4-7f77-4242-90a5-1572e9a9169e)
| ![The patch is public; its guests stay listed and adding
waits](https://github.com/user-attachments/assets/c4a471c0-10fb-437e-a8b3-50d23f035f55)
|

**Phones.**

| Menu | Refused | Going public | Public |
| --- | --- | --- | --- |
| ![Menu at
390px](https://github.com/user-attachments/assets/174abee3-8963-4aaa-81ac-bccf1cd7ea1e)
| ![Refused at
390px](https://github.com/user-attachments/assets/cacad84f-421c-4685-92f0-415ff3651e0f)
| ![Going public at
390px](https://github.com/user-attachments/assets/add01bdf-d474-4bb5-a596-b5370a24d7ef)
| ![Public at
390px](https://github.com/user-attachments/assets/4a5f5c0b-1281-4f06-b030-6a753e5b108b)
|

<details><summary>The menu on All patches, desktop</summary>

![Share… in the row's
menu](https://github.com/user-attachments/assets/cd0f3dcf-9fe5-4b99-870c-e68270645db3)

</details>

**Settings loses its sharing section.** Who can open a patch now changes
in one place, the dialog.

| Before | After |
| --- | --- |
| ![Settings
before](https://github.com/user-attachments/assets/8e15feaa-9bef-411b-afeb-336cbe66a6ee)
| ![Settings
after](https://github.com/user-attachments/assets/9ea68fdd-a80c-438c-972f-336290543607)
|
| ![Settings before,
phone](https://github.com/user-attachments/assets/805e22a9-a51d-47a3-88c0-1a49cb76dc80)
| ![Settings after,
phone](https://github.com/user-attachments/assets/474291e0-259a-4916-821b-c2a0971f4f6a)
|

**Shared with you, on Taylor's Home.** Cedar Works' own empty state and
Connect your agent stay; the shelf follows them and isn't shown under
search results.

![Shared with you on a guest's
Home](https://github.com/user-attachments/assets/b4c5699a-1e59-4431-be2d-14e54aa8425e)

<details><summary>Phone</summary>

![Shared with you at
390px](https://github.com/user-attachments/assets/929a22bf-09f2-490d-b65c-5e03f23b5061)

</details>

### Decisions worth checking

- **The dialog is server-drawn, with no script.** `?share=<name>` opens
it over Home, All patches or a card. Each add, remove or scope change is
a form post that comes back to the same page with the dialog open and
its receipt inside it. A refusal re-renders that page with the dialog,
the email kept and the callout under the field. Going public shows its
confirmation once the radio is picked, through CSS `:has()`; Cancel is a
reset button, and only Make public sends `confirm=public`. On a tier 2
patch the public choice is `disabled`, and a forged post is still
`tier2_not_public`.
- **Refusals are codes.** `not_on_patchy` covers both unknown and
deactivated accounts, so Share never reveals another company's state.
Next are `already_member` and `guests_unavailable` with `reason`. A
retired or deleted patch answers `wrong_state`, through the existing
owner check (`Patches.manage`, the lifecycle acts' `manageable`), never
404.
- **`GuestReason` moved to `@patchy/api` and is keyed by `code`, not
`_tag`.** It now rides on the wire, and wire refusals carry no `_tag`.
`guestReasonText` is the one place its words come from; the CLI and the
portal format from the code.
- **`GuestGrants` owns the share act.** `share`, `remove` and `list`
each check the actor through `Patches.manage` in one transaction, so the
API and the portal can't drift. That makes `GuestGrants` depend on
`Patches` and `Users`, wired in `apps/server`. `Server.layer` now
exposes `GuestGrants` beside `Runtime`, so the server's guest tests use
the real one.

## How it was verified

New and changed tests:

```
✓ test/browser-tier1/sharing.spec.ts › an owner shares a page from its menu, and the guest opens it from Home and removes it
✓ packages/patches/src/PatchesApi.test.ts › shares an owned patch with someone at another company, and says why it won't
✓ packages/patches/src/PatchesApi.test.ts › publishes a version its guests can't open, and says why only when it has guests
✓ packages/portal/src/PortalPages.test.ts › adds and removes guests in the Share dialog over the page it opened from
✓ packages/portal/src/PortalPages.test.ts › lists what's shared with a guest on their Home, and removes one after asking
✓ packages/portal/src/PortalPages.test.ts › asks in the Share dialog before a patch goes public, without publishing a version
✓ packages/portal/src/PortalPages.test.ts › refuses public sharing while tier 2 is served and allows it after rollback
✓ packages/patchy/src/cliPublish.test.ts › patchy share › adds, lists and removes a patch's guests, one JSON document each
✓ packages/patchy/src/cliPublish.test.ts › patchy share › keeps $code and its source when sharing is refused
✓ packages/patchy/src/cliPublish.test.ts › patchy share › rejects invalid targets, scopes or operations locally
✓ scripts/dev/src/scenario.test.ts › refuses a guest from the scenario's own company
```

- **API refusals and re-sharing:** the API test refuses an unknown
email, a deactivated account, a member of the company and a non-owner,
each by code. It shares, shares again unchanged, removes by email,
removes again (`removed: false`), shares again with a new `grantedAt`,
and gets `wrong_state` on the retired patch, which keeps its guests. The
publish test adds the `guests_unavailable` refusal with `reason: { code:
"connection_blocked", … }`.
- **Tier 2 can't go public from the dialog:** its radio is `disabled`,
there's no Make public, and both an unasked and a confirmed post answer
422.
- **The scenarios:** `pnpm dev up brightline` shares Kudos with Taylor
through `patchy share --add`. The environment's CLI then lists Taylor,
and refuses an unknown email with exit 2.
- **Rebased onto PR 4's `e5eb486`:** typecheck is clean, and the portal,
`PatchesApi`, `GuestGrants` and server guest suites pass (170 tests).
`docs/API.md` re-renders unchanged.
- **`pnpm verify`:** format, lint, typecheck, synth,
postgres-concurrency, cli-smoke, install, tier2-smoke and browser (75
specs) pass.
- `test` fails only suites that record a stray `GET /` this machine's T3
app sends to local ports: the CLI stub suites, `RequestEvents` and
`LocalTaskProvider`. A different test fails each run.
- The two that touch sharing, `cliRepoRecovery`'s "uses the repo
identity for share and delete" and `cliPublish`'s `patchy share` block,
pass when rerun alone.

## Release impact

Tick exactly one.

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

It adds API routes and CLI flags, and moves the portal's scope control
from Settings into the Share dialog. It adds no migration and no
descriptor field, so this PR on its own isn't one-way. The stack ships
as one deploy and is fix-forward.

- **What does a revert leave behind?** Grants made through Share, in PR
1's `patch_guest_grants`, plus agents that learned `patchy share --add`.
- **Does the release before it still work with that?** Yes, with PRs 1–4
deployed: they read and admit those grants. Without Share, nothing new
writes 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]>

---------

Co-authored-by: Srikar Voleti <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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:cli Touches the cli area area:docs Touches the docs area area:primitives Patch tables and files area:server Touches the server area one-way Rolling production back past this PR would break the release before it size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(guests): allow directory use through guest-marked tier 2 handlers

1 participant