Repository navigation
feat(guests): admins block guests from a connection - #1112
Conversation
Sol reviewReviewed
Standards: no additional findings. The service boundary, Schema decoding, Effect composition, shared UI components and focused tests look consistent. Spec otherwise: checked next-call blocking and unblocking without re-sharing, the member admission fast path, active-grant-only batched warnings, successful publish with Validation: all 181 tests in the six focused suites passed; the additional interleaved-publish reproduction failed the expected continued-admission assertion. The existing rollback-rehearsal CI failure reports an unsettled Deploy run, rather than a code failure. Verdict: SHOULD FIX before merge — one finding. |
|
Fixed the should-fix in the Sol review in b27c9bb.
The grant query no longer joins The regression test is in |
Sol re-checkRechecked Findings: no blockers, should-fix items, or nits. The earlier should-fix is resolved.
No Effect service findings. Applicable mirrored surfaces were the runtime port, server adapter and serving door; this fix changes no wire/CLI contract, migration or rendered UI. Validation: 86 tests passed across Verdict: PASS for this fix commit. |
9f487c1 to
ab19f74
Compare
b27c9bb to
591c350
Compare
Acceptance: PASS with notesChecked The connection used here was a scenario-only Postgres fixture with invented metadata and unused credentials. Its guest-marked handlers used their own table; no external database or integration was contacted. Done means
Main-feature interaction
Golden journeys
Evidence Rollback answers: match the diff. Migration Not run
Notes
|
ab19f74 to
21c941c
Compare
An admin can now block guests from a sensitive connection on its page. A patch whose current version declares a blocked connection turns its guests away at their next call, keeps their grants, and lets them back once the block is off or the declaration is gone. Members are unaffected. - 0032 adds connections.block_guests, false for every existing connection. - ConnectionStore gains blockGuests and blockingGuests, one read for any number of connections, so patches never reads integrations' tables. - GuestGrants.unavailable gains ConnectionBlocked; describe words every reason in one place. Only a grant holder's admission reads the block flags. - The card, Needs attention and publish's warnings say why when a patch with active grants turns its guests away. A publish stays a success. Co-authored-by: Srikar Voleti <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
GuestGrants.host compared the caller's loaded version with the patch's current version read again in its grant query. A publish between the two reads turned an eligible guest away, and a guest's stream recheck then closed their live document. The caller now passes the patch's state and whether the version was current in its own read: the serving door from the patch it found, and Runtime through LoadedVersion.current, set by Patches' loader. host reads only the grant and, for a grant holder, the version's connection blocks in one read. Co-authored-by: Srikar Voleti <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
591c350 to
5cbfc94
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
Admins had no way to keep a sensitive connection away from a patch's guests. A connection's page now has Block guests: only admins can use it, and members see whether it's on. While it's on, any patch whose current version declares that connection turns its guests away from their next call. Their grants stay, so they're back once the block is off or the patch stops declaring the connection. Members are unaffected.
The owner and admins see why on the patch's card and in Needs attention. A publish that turns guests away still succeeds, and its
warningssay why. Warnings only appear for a patch with active grants.This is the third of six stacked PRs. Sharing has no surface until PR 5, so the tests and screenshots write grants directly.
Closes #1078
Look at
GuestGrants.unavailable(patch, version, blocked)gainsConnectionBlocked { integration, handle }.GuestGrants.describeis the only place a reason becomes words, and the card, Needs attention and publish all use it.ConnectionStore.blockingGuests(ids)reads any number of connections' flags in one query, sopatchesnever reads theconnectionstable.GuestGrants.hosttakes the version the door already holds and reads the grant, with the patch's state and current version, in one query. It goes on to the flags only when a grant is found.LoadedVersion.admitsGuestsis gone: the runtime port askshost(loaded, userId)for anyone outside the company and fails withSourceUnavailable.unavailableToGuests(companyId)makes one query for the company's live, company-only patches with active grants and their current declarations, plus one block read. Only an owner's or admin's pages run it.unavailableAfterPublish. It's silent for a new patch, a patch without grants, or one going public.Screenshots
These follow
pnpm dev compare's method: full page at 1280 and 390 px, scale 2, signed in as Allison (admin) on two freshattioinstances, base9f487c1and head27e0a14. Compare itself can't reach this state, because the connection page is addressed by a per-instance id and the grant needs sharing (PR 5). So both sides first got the same state: a guest from Pine Studio with a grant on Deal desk, written directly. On head,attio/crmwas then blocked through the page's own POST.Connection page, desktop. Head shows Guests: Blocked and Allow guests.
Before
Deal desk's card, desktop.
Before
Needs attention, desktop.
Before
How it was verified
New focused tests:
access_denied, while the admin's own call still answers.PublishUpdatedsuccess, and itswarningsholdGuestGrants.warning(ConnectionBlocked …). The CLI exits 0 on a successful publish whatever its warnings say (ADR-0004).blockGuests: false.integrations,runtime,serving,patches,portal,primitives,mcpandapps/server.pnpm check: format, lint, typecheck and synth pass.cliPublish,cliLook,cliLifecycle,cli,EngineandRequestEvents. They come from strayGET /requests reaching local test servers on this machine.RequestEventsandEnginepass when rerun alone.pnpm verify: postgres-concurrency, cli-smoke, install and tier2-smoke pass.testfailed the same stray-request CLI suites, plusLocalTaskProvider, aSupervisortimeout andRequestEvents, none of which this PR touches.browserstopped attier1.spec.ts"hostile navigation…", where a stray/reached its foreign-origin server, as on PR 2.docs/API.mdis unchanged: the wire doesn't change, andblockGuestsstays off the public connections API because nothing reads it there.Release impact
Tick exactly one.
The migration adds a column whose default allows guests, so every existing connection behaves as before.
block_guestscolumn (0032_connections_block_guests) and any blocks admins have set.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]