Repository navigation
feat(guests): guests call the tier 2 handlers marked for them - #1110
Conversation
Sol reviewReviewed No blocker, should-fix or nit findings on either axis.
Validation: 12 focused suites passed, 143 tests, covering the whole-server guest journeys, live queries, descriptors, inspection, member wire, runtime invocation/streams, queued Attio/Pidgeon checks, dev mount and scenario seeding. Verdict: PASS — no actionable standards or PR 2 contract findings. |
3a425bd to
9f487c1
Compare
f7d7e04 to
75b60f9
Compare
9f487c1 to
ab19f74
Compare
Acceptance: PASS with notesChecked Done means
Golden journeys
Evidence Rollback answers: match the diff. Published descriptors retain Not run
Notes
|
A guest of a tier 2 patch starts only the handlers marked `guest: true`, queries, mutations, actions and live queries alike; nested calls follow the usual rules. Tier 2 becomes open to guests, unless its version reads another patch's shared table or store. - `guest: true` in the SDK's handler options and the descriptor, read by the strict loader and inspection; agent tools never carry it. - The worker wire still carries `guest` only for guests. - `reauthorize` lives on the Binding, required, and Attio's and Pidgeon's post-wait rechecks share one helper over it. - `patchy dev` serves a guest's view at `guestUrl`, with no agent door, and `pnpm dev up guests` brings up two companies. - The CLI says workerd couldn't start during inspection, and to run `pnpm install`. Closes #1079 Co-authored-by: Srikar Voleti <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
ab19f74 to
21c941c
Compare
## 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
Guests could open tier 1 patches only: a tier 2 patch has handlers, and without a way to choose which ones a guest may run, letting a guest in would have let them run all of them. Now a builder marks the handlers guests may start with
guest: true. A guest of a tier 2 patch starts those and no others, queries, mutations, actions and live queries alike. A tier 2 patch that reads another patch's shared table or store stays closed to guests.This is the second of six stacked PRs. Sharing still has no surface (that's PR 5), so the tests grant through the domain service.
Closes #1079
Look at
Invocation.callrefuses a guest's top-level call to an unmarked handler, next to the agent-tool rule (packages/runtime/src/Invocation.ts). Browser calls, live-query reruns and agent calls all enter there;ctx.runinside a marked handler follows the usual rules. The mark travels from the SDK builders through the descriptor schema, the strict loader, inspection and publish'ssameHandlers. Agent tools drop it, since they're for agents only.reauthorizenow lives on theBinding, and it's required. It replaces the separate parameter onInvocation.call,InvocationCapabilities.Issueand the optional field onSubscriptionReads.Input. Every door that builds a binding says how to ask about its viewer again. Attio's and Pidgeon's post-wait rechecks are now one helper,viewerRecheck(binding)inpackages/integrations/src/definition.ts, instead of aDirectorylookup that would have refused every guest. Most of the line count is tests building a binding with the new field.GuestGrants.unavailableadmits tier 2 and gainsSharedSource { kind: "table" | "store", alias }. The member directory doesn't count against a patch.viewercarriesguestonly for a guest, so bundles stored before guests keep serving members:patchy devreturns aguestUrl: the patch's guest from another company, withguest: trueand no/~dev/agentdoor.pnpm dev up guestsseeds Harbor Works plus Jo at Pine Studio, with Site notes (tier 1) and Visit log (tier 2). Visit log has markedlist/createand an unmarkedclear.companiesand a person'scompany.pnpm install, keepinginvalid_manifest.How it was verified
The two-company journey over the whole server, with real workerd. Both tests fail with the gate removed:
by: <their id>, the patch's company,guest: true) and the marked query lists the row. The unmarked query isaccess_denied. After a soft revoke, the marked query isaccess_deniedtoo.access_deniederror frame.pnpm dev up guestson a local instance published both patches through the real CLI, soguest: truesurvived the build, inspection and publish. In Visit log'spatchy dev:meis Dev Guest in Harbor Works withguest: true.notes.createandnotes.listwork, signed "Dev Guest", andnotes.clearisaccess_denied./~dev/agentanswers 404, and the colleague'snotes.clearworks. The environment was taken down afterwards.guest: falserefusal, SDK agent-area fold, inspection, eligibility, invocation, Attio and Pidgeon operations (the queued-caller recheck now uses the door's check), scenarios.pnpm check: format, lint, typecheck and synth pass.cliPublish,cliLook,cliLifecycle,cliRepo,cli),LocalTaskProviderandRequestEvents. All of them come from strayGET /requests reaching local test servers on this machine, and the set changes between runs.RequestEventsandPatchesApi(a 5 s timeout under load) pass when rerun alone.pnpm verify: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install and tier2-smoke pass.testfailed the same stray-GET /CLI suites andSupervisor, which fails on cleanmainhere too.browserstopped attier1.spec.ts"hostile navigation…", where a stray/reached its foreign-origin server. A rerun ofpnpm test:browserhit the same thing. CI'sbrowserjob passed on this commit.3a425bd: every required suite passed,teston Node 22/24/26 andbrowserincluded.rollback-rehearsalcan't run while Deploy run chore: delete .env.example and add a bidirectional env-registry check #30 waits for approval.attio-livefailed one live read on anAttioUnavailable503 from Attio, with the other 8 passing. It's rerunning.Release impact
Tick exactly one.
New descriptor field and a new reason; members see no difference, and
patchy dev --jsononly gainsguestUrl.guest: true, and grants on tier 2 patches.guest: true, so it can't load those versions. This is one-way: fix forward, and the whole guest stack ships 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]