Repository navigation
feat(guests): guests can be the person in a member column - #1113
Conversation
Sol reviewReviewed
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 Compatibility judgment: 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. |
|
Fixed both should-fix findings from the Sol review (e5eb486).
Tests: a new two-grant/revoke-one case in Docs: the members skill, |
Sol re-checkRe-checked Blockers / should fix: none. Both original findings are fixed through the real server/workerd path:
Nit — documentation conflates account activity with email visibility. Compatibility: keep 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. |
|
Correction to the acceptance note on a guest's |
b27c9bb to
591c350
Compare
9647ccd to
4c7387b
Compare
Acceptance: PASS with notesChecked Done means
Main-feature interaction
Golden journeys
Evidence Rollback answers: match the diff. Trigger/migration Not run
Notes
|
591c350 to
5cbfc94
Compare
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]>
4c7387b to
fa0ef51
Compare
## 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 | | --- | --- | --- | |  |  |  | | Going public | Public | | --- | --- | |  |  | **Phones.** | Menu | Refused | Going public | Public | | --- | --- | --- | --- | |  |  |  |  | <details><summary>The menu on All patches, desktop</summary>  </details> **Settings loses its sharing section.** Who can open a patch now changes in one place, the dialog. | Before | After | | --- | --- | |  |  | |  |  | **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.  <details><summary>Phone</summary>  </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]>
## 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]>
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 neveradmin, and showsactive: falseonce 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'spatchy 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
guestis present only on guests, notguest: booleanon everyone. This deviates from the plan. The host decodes handler results strictly. A required key on every member broke brightline's Spend immediately: itsrequests.listreturns members throught.object({ id, name, email, admin, active }). It would break every published tier 2 version that does the same. Withguest?: true(wire,Directory.Memberand the SDK'sMember), members are byte-identical to before, the same choice PR 1 made forme().guest. A result schema that passes members through whole fails only once it returns a guest, and the members skill states that fact.Directorytakes aScope { companyId, guests: Map<userId, active> }as plain data. The server'sMemberDirectoryadapter, which already bridged companies and primitives, fills it from Patches'GuestGrants:guests(patchId), so they're per patch;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.0033_guest_grants_directoryadds a trigger onpatch_guest_grantsthat bumpscompanies_directoryand notifiesmembers:<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.sql.inover an empty list renders1=0, which Postgres folds away.Kudos, with Taylor of Cedar Works shared on it
These come from a local
pnpm dev up brightlinewith 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.Allison's picker offers Taylor, marked Guest
The picker no longer shows emails, because its handler doesn't return them.
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:
guest: trueandadmin: false. Gina is her own company's admin, which makesadmin: falsemeaningful. Another patch's picker doesn't offer them.active: false, and assigning them isinvalid_row.getMany.companiesDirectory, all ofprimitives,sdkanddevMemberspass.apps/serversuites: Guests, Members, StreamLifecycle and migrations. AlsoGuestGrantsand the scenario loader: 143 tests.pnpm dev up brightlinebuilds and loads all three tier 2 patches. Kudos' generated repo passes its ownpnpm typecheckandpnpm lint.pnpm check: format, lint, typecheck and synth pass.GET /requests from this machine:cliPublish,cliLifecycle,cliLook,cliRepo,cliRepoRecovery,RequestEventsandLocalTaskProvider. Their logs show{ method: 'GET', url: '/' }.RequestEvents,LocalTaskProvideranddevExecutionpass when rerun alone.pnpm verify: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install and browser pass.tier2-smokefailed 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.testfailed only the stray-request suites above, pluscli.testandLocalTaskProvider.b27c9bb: typecheck and lint pass, and the guest, directory, primitives, serving and migration suites pass (165 tests).docs/API.mdis unchanged:render-docsproduced no diff.Release impact
Tick exactly one.
Members read exactly as before, since only guests carry
guest. The migration adds a trigger and no columns.patch_guest_grants_directory_changedtrigger (0033_guest_grants_directory). Rows written while it ran may hold guests' ids in member columns.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]