Repository navigation
feat(teams): store teams, and keep team data closed until teams ship - #1416
Conversation
324814f to
0c64824
Compare
Migrations 0039 to 0041, as the release with team audiences writes them: teams with their members and membership history, a patch's `teams` scope with the teams it names and its owner history, and a connection's audience. Every existing patch and connection keeps what it had. Nothing in this release writes them yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A release that reads patches but not team audiences can't tell who may open a `teams` patch. Every read now leaves one out, as it leaves out a disabled patch: lists, cards, addresses, guest grants, shared sources, lifecycle and sharing changes, and a connection's recent calls. Its address answers 404 and nothing can change its audience. Reclaiming a deleted patch also removes its owner-history admin additions, which no foreign key cascades. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…teams A connection whose audience is `teams` is used by nobody in a release that can't check teams: publish refuses it, every call refuses it, and discovery, agents' reads and SDK generation leave it out. Admins still see it on Integrations, marked Restricted to teams, and its usage counts its team patches without naming them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A CLI released with team audiences sends `audience`. Ignoring it would make a team-only first publish company-wide, so a body that names one answers 400 `upgrade_required`, after replay, which that CLI treats as a definitive refusal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eclaimed A patch's calls stay in the log after reclamation removes its row, and nothing then says whether it was open to teams. The Calls tab now shows calls made from no patch or from one that exists and is not open to teams, so a reclaimed team patch's calls, SQL included, never come back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e its replay A later CLI that lost the answer to a team patch's first publish retries the same payload. The replay answered with the stored response, naming a patch this release opens for nobody. The audience refusal now runs first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The form's decode dropped an audience field and applied the scope, so a form meant for teams could make the patch public or company-wide. It is now refused before anything is decoded or changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… grants People lists a guest's grants without team patches, but its Remove ended those too, so rolling forward restored a team patch with its guests changed. The removal now ends only grants on patches this release opens. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Integrations counted a team patch as disabled, so a member saw that a hidden patch declared the connection. Usage now leaves team patches out of every name and count; they still keep the connection from deletion. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ab hides Integrations' Last call read the newest call of any patch, so a team or reclaimed patch's activity showed even when the Calls tab was empty. It now admits only the calls the Calls tab shows, before taking the newest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t there A publish retry returned its stored answer before any patch check, so a patch later opened to teams was named, with its title and ids, to its owner. A retry whose patch is now open to teams answers 404 and publishes nothing, a create's retry included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0c64824 to
39c4429
Compare
Acceptance: PASS with notesChecked Done means
Golden journeys
Rollback answers: match the diff when this bridge ships before the feature. The head's rollback job ran all four steps, Not run
Notes
Normal installs used Node 24.20.0 without a minimumReleaseAge override. Heavy work used the shared lock; every installed CLI used this environment's own |
…ey shortcuts (#1421) ## What changed This adds release 42's What's new entry, written from `1cd6d12`. It covers everything merged since release 41's `through` (`a25a9c5`), and sets the `patchy` release to `0.42.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Tell Patchy what it's missing | #1217, #1218, #1219, #1227, #1228 | | New: Turn off single-key shortcuts | #1276, #1279, #1301 | | Fixed: Typing reaches the patch again | #1407, #1412 | | Fixed: Dialogs in patches keep your place | #1420, #1255 | | Behind the scenes: plainer facts for agents building patches | #1249, #1256, #1297, #1418 | | Behind the scenes: Patchy stores teams and audiences ahead of teams | #1416 | | Patch changes: Mod+/ and `client.close()` in patchy/hotkeys; single-key shortcuts can be off; Tab wraps in plain modal dialogs | #1279, #1301, #1420 | #1376 is release 41's own entry. #1400, #1406, #1414, #1415, #1302, #1413 and #1419 are test, CI and dev tooling and need no line. The teams bridge (#1416) ships alone in this release so teams (#1417) can follow in the next one with a release to roll back to that reads its data closed. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `7f93b91` (release 41) to this PR's merge.** No PR in the range is labelled `one-way`, and every Release impact answer says release 41 still works: - **#1217** adds migration `0037_feedback`, a schema release 41 never reads. **#1227** and **#1228** write into it. - **#1276** adds migration `0038_single_key_shortcuts`, a column with a default that release 41 never selects. - **#1416** adds migrations `0039_company_teams` to `0041_connection_audiences`, which hold tables that stay empty until teams ship, and widens one scope check. Its CI rehearsal ran `7f93b91 → head → 7f93b91 → head` on one set of data, and all four steps passed. - **#1279**, **#1301**, **#1255** and **#1420** change the SDK and the shell. Patches built on this release carry a `shortcutSetting` manifest field that release 41 reads without refusing, and its shell names no frame, so every shortcut stays on. - **#1218** and **#1219** add CLI commands and an optional `feedbackHint` in `--json` failures. A CLI from this release refuses to publish to an older instance before sending anything, as any mismatched release does. - Everything else is skill text, docs, tests and CI. If this release misbehaves, roll back to `7f93b91` (release 41). Written by Claude Opus 5.5 in Claude Code, through T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
…ctions (#1417) ## What changed A company can now make teams, open a patch to chosen teams instead of the whole company, and limit who builds with a connection. Roles stay member and admin. - **Teams.** - Admins create, rename and delete teams and manage anyone's memberships. - Members see every team and roster. - A team can be deleted only when nothing uses it, and the refusal says what does. - The Teams page is a roster editor: tick people in or out, then review who gains, loses or keeps what before saving. - **Patch audiences.** - Company (the default), one or more teams, or Public, plus named guests as today. The owner must stay inside the audience. - A team patch's first version and its audience commit together, so it is never briefly company-wide. - Removal takes effect on the next request and on open live queries, on every surface: portal, serving URLs, API, CLI, MCP, tier 2 handlers and shared tables. - **Admins.** - Admins manage every patch's owner, audience and sharing, but open its content only through its audience. - The owner sees every audience change someone else made, and every admin added to one of the patch's teams. - Needs attention shows patches whose owner lost access. - **Connections.** - A connection's teams decide who builds with it: the patch's owner must be on one, and a deactivated owner's patches keep working as before. - Anyone the patch is shared with can use it through the patch's code. - Shared tables keep the per-viewer check, and publish warns when a patch reaches people its sources don't. - **CLI.** - `--share company|public|teams --team <name>` on `publish` and `share`, plus `patchy audiences`. - Installed CLIs keep working. - A scope-only request on a team patch is refused with an upgrade message instead of being ignored. Closes #1285, #1286, #1287, #1288, #1289, #1290, #1291, #1365, #1367, #1368, #1403, #1408, #1410. Supersedes #1284 and #1361: there is no super admin, and team rules follow #1192's decisions. #1416, the rollback bridge, shipped first, in release 42. ## Look at **The Teams page.** Mock B was picked from three directions. The team list sits beside the open team. Its access card shows what the team can open and build with. The roster is the editor, and a sticky bar counts the changes.  **Review before saving.** It says what added people will reach and what removed people lose or keep, and warns about live patches that will stop working.  <details><summary>Delete refused while in use, the member view, the phone screens, and the old page</summary>   | Phone, list | Phone, team (admin) | Phone, team (member) | | --- | --- | --- | |  |  |  | Before (the previous Teams page):  </details> **Also worth a look:** - **One audience value in code.** The wire keeps the released two-valued `scope` and adds `audience`. A test decodes the list, publish, publish-replay and share responses with the released CLI's schema. - **Concurrency in forced interleavings:** - a team deleted while a share adds it; - a connection narrowed while a publish uses it; - an admin added to a team while a guest is removed; - a stale roster review; - the last-admin guard. ## How it was verified - **Tests.** Every behaviour fix has a focused test that fails without it. In an earlier end-to-end run, 21 of 22 deliberate breaks of the access checks were caught; the 22nd now has a test. - **`pnpm verify`** passed on the final code. The new audience check made two serving cache tests racy in the Bun lane; they now wait past it, and a forced slow check fails the old tests and passes the new ones. - **Rollback.** The full four-step rollback rehearsal, with release 42 (the bridge) as the live release, passed on this head: bridge, then this, then the bridge, then this. CI's own rehearsal job passes at once here, because the migrations live in the bridge (#1416), where CI rehearsed all four steps. In a hand-run rollback onto the bridge with real team data, team patches went hidden and team-only connections unusable, with no 500s, and rolling forward restored both. - **Acceptance (GPT 6.1 Sol, on throwaway instances): PASS with notes** on this head. The first run failed on three Teams page defects, all since fixed and re-checked with its own reproductions: - admin names were rendered as HTML; - an outdated roster review could still save; - a roster save could deadlock against a profile refresh. It also checked every role, every surface an outsider must be refused on, live revocation, admin oversight, stuck owners, connections, shared tables, and the released CLI against this server. - **Reviews.** Four GPT 6.1 Sol review passes; all findings are fixed. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Roles, `/api/me`, and existing patches and connections are unchanged: patches stay Company, connections stay company-wide. Installed CLIs see `company` or `public` for every patch, and get an upgrade message only when changing a team patch's sharing with a scope alone. - **What does a revert leave behind?** Teams, memberships, team audiences, connection audiences and history rows. - **Does the release before it still work with that?** Yes, if it is the bridge (#1416). Team patches go hidden and team-only connections unusable, nothing widens or 500s, and rolling forward restores both. Deploy this only after the bridge is live, and never roll back past the bridge once team data exists. Taken over from Srikar's teams work (#1404, co-authored). Built by Claude Opus 5.5 in Claude Code, reviewed by GPT 6.1 Sol. --------- Co-authored-by: Srikar Voleti <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…onnections (#1422) ## What changed This adds release 43's What's new entry, written from `1cbd39f`. It covers everything merged since release 42's `through` (`1cd6d12`), and sets the `patchy` release to `0.43.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Teams | #1417 | | New: Share a patch with just your team | #1417 | | New: Choose who builds with a connection | #1417 | | Improved: Admins look after every patch without opening it | #1417 | | Behind the scenes: earlier agents and CLIs keep working, and are asked to update before changing a team patch's audience | #1417 | | Patch changes: shared-source reads can be refused per viewer, and team-only connections follow the owner's teams | #1417 | #1421 is release 42's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `7028ec6` (release 42) to this PR's merge.** The only PR in the range is #1417, which isn't labelled `one-way`. - Its migrations shipped with release 42, the bridge (#1416), and the teams change adds none. - Release 42 reads team data closed: team patches are hidden and team-only connections unusable, with nothing widened and no 500s. - The four-step rehearsal `7028ec6 → #1417 → 7028ec6 → #1417` passed on #1417's head, run locally because CI's job skips when no migration changes. - Never roll back past release 42 once teams exist: earlier releases don't read the audience tables, so nothing keeps team patches closed there. If this release misbehaves, roll back to `7028ec6` (release 42). Written by Claude Opus 5.5 in Claude Code, through T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
Teams will let a patch be opened only by chosen teams, and a connection be built with only by chosen teams. That data can't be read by today's release. If the feature shipped on its own, rolling back would 500 every page listing a team patch, and team-only connections would quietly become company-wide.
This PR ships first, on its own. It adds the teams tables and makes every reader fail closed on team data:
upgrade_requiredand never ignored.It writes no team data, so nothing changes for anyone until the feature lands on top of it.
Part of #1192. The feature is the next PR in the stack.
Look at
The migrations (
0039_company_teams,0040_patch_audiences,0041_connection_audiences) are byte-identical to the feature's, so the feature PR adds none.Rollback onto this release, run by hand. On a throwaway instance, the feature created a Finance team, made a patch Finance-only with two outside guests, and restricted a Postgres connection to Finance. This release was then served on the same data, then the feature again:
How it was verified
pnpm verifypassed.Release impact
Additive tables and a widened scope check. Installed CLIs never send an audience, and no team data can exist yet.
Taken over from Srikar's teams work (#1404, co-authored). Built by Claude Opus 5.5 in Claude Code, reviewed by GPT 6.1 Sol.