Skip to content

fix(builderlab): replace apps_share with visibility and community tools - #1934

Merged
nathan-thillairajah merged 5 commits into
mainfrom
dylan/apps-share-visibility-community
Oct 29, 2026
Merged

nathan-thillairajah merged 5 commits into
mainfrom
dylan/apps-share-visibility-community

Conversation

@nathan-thillairajah

@nathan-thillairajah nathan-thillairajah commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Buzz desktop gives local agents an apps_share tool for sharing a Builderlab app. It shares by granting access to another Builderlab workspace. That model is going away (BOT-2440): an account belongs to one workspace, and an app is open either to everyone in that workspace or only to its owner, plus any Buzz communities it's shared with. squareup/blockplat-compose#496 removes the workspace-grant route and #500 adds the visibility switch. Once Compose ships them, apps_share fails every time, and agents have no way to make an app private or share it with a community.

What changes

  • apps_share is removed.
  • apps_visibility switches an app between everyone in the owner's workspace and only the owner. The answer says who can open it now, for example "Only your owner. So can members of the Buzz community it is shared with."
  • apps_community shares an app with a Buzz community or stops sharing it.
  • If Compose refuses the community-sharing read because the app has no sharing lifecycle yet (older apps; new apps get one when they're created), the agent is told to deploy the app and retry. It used to say "This app has no active sharing to change".

The requests match what bl apps visibility and bl apps community send (block/builderlab-cli#38, #39).

Testing
Unit tests cover the requests and the agent-facing answers. It hasn't been tried in the app against staging yet. The owner still has to supply the community's ID.

Rollout
This needs to reach users in a Buzz release before, or together with, the production Compose update. Older Buzz builds keep the broken apps_share.

🤖 Generated with Claude Code

nathan-thillairajah and others added 4 commits October 29, 2026 16:33
Compose removes workspace grants (squareup/blockplat-compose#496), so
apps_share's sharing/workspaces route stops existing once Compose is
bumped. Under the one-workspace model an app is open to its workspace or
only its owner, plus any Buzz communities.

- apps_visibility switches workspace/only_you through PUT .../visibility,
  as `bl apps visibility` does, and says who can open the app now.
- apps_community grants or revokes a community at the grant revision it
  just read, as `bl apps community` does.
- An app with no live version now says to deploy it first instead of
  "This app has no active sharing to change".

BOT-2440

Co-authored-by: Dylan G <69953f73c9f5149d56f2155107338a5435823b938a6c430c63e779f9a8a446f9@remote-agent-pilot.communities.buzz.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nathan Thillairajah <nthillairajah@squareup.com>
Address review on #1934: a 200 sharing read without a valid lifecycle or
non-negative integer revision now says nothing was changed instead of
asking for a redeploy, and a mismatched visibility answer points at
Share & manage rather than an access read no tool offers. Adds tests for
the app_id mismatch, POST/DELETE 409 passthrough, tool-level grant and
unknown action, and plural wording.

Co-authored-by: Dylan G <69953f73c9f5149d56f2155107338a5435823b938a6c430c63e779f9a8a446f9@remote-agent-pilot.communities.buzz.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nathan Thillairajah <nthillairajah@squareup.com>
The mismatch test matched only the prefix, so it passed with the old
"read the app's access" advice. Assert the full Share & manage text.

Co-authored-by: Dylan G <69953f73c9f5149d56f2155107338a5435823b938a6c430c63e779f9a8a446f9@remote-agent-pilot.communities.buzz.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nathan Thillairajah <nthillairajah@squareup.com>
The remaining viewers on a private app include publishers, who were never
"added". Matches the Share & manage dialog wording.

Co-authored-by: Dylan G <69953f73c9f5149d56f2155107338a5435823b938a6c430c63e779f9a8a446f9@remote-agent-pilot.communities.buzz.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nathan Thillairajah <nthillairajah@squareup.com>
@nathan-thillairajah
nathan-thillairajah marked this pull request as ready for review October 29, 2026 21:27
@nathan-thillairajah
nathan-thillairajah requested review from a team as code owners October 29, 2026 21:27

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Two documentation/test-contract corrections; no runtime or authorization defect established.

Comment thread src/bundled/builderlab/apps/client.ts Outdated
const undeployed = new Error(
"This app has no live version to share yet. Deploy it with apps_deploy, then try again.",
);
// Compose answers this read with 409 only when no version is live.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [P3] Describe the missing-lifecycle condition rather than undeployed apps. Compose reservation already sets HostedSiteLifecycleID (internal/deploy/reserve.go:150); the GET returns 409 only when that ID is empty (internal/app/sharing_grants.go:275–278). Consequently, create → community grant before deploy can succeed as a metadata-only update. Please rename the comment/test around missing sharing lifecycle and correct the PR description; the deploy hint can remain for that condition. This is established by upstream source inspection, not a live-server reproduction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Fixed in 46c92ba. The comment, error text and test now describe a missing sharing lifecycle; I confirmed reservation (reserve.go:150) and rollout (rollout.go:162) set it, so the deploy hint stays. The PR description is corrected too.

Comment thread src/bundled/builderlab/README.md Outdated
Sharing follows the one-workspace model: `apps_visibility` switches an app
between everyone in the owner's workspace and only the owner, and
`apps_community` grants or revokes a Buzz community at the grant revision it just
read. Both keep existing viewers and community grants.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [P3] Scope the preservation promise to apps_visibility. apps_community revoke intentionally removes a community grant, so saying both tools keep existing community grants contradicts its behavior. Suggested wording: apps_visibility keeps existing viewers and community grants.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Fixed in 46c92ba with your wording.

Compose answers the community sharing read with 409 only when the app has
no sharing lifecycle. Reservation sets one, so a created but undeployed app
can be shared; the 409 is for older apps, which a deploy fixes. Also scope
the README's "keeps existing grants" promise to apps_visibility, since
apps_community revoke removes one.

Co-authored-by: Dylan G <69953f73c9f5149d56f2155107338a5435823b938a6c430c63e779f9a8a446f9@remote-agent-pilot.communities.buzz.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Nathan Thillairajah <nthillairajah@squareup.com>
@nathan-thillairajah
nathan-thillairajah merged commit 15500c0 into main Oct 29, 2026
37 checks passed
@nathan-thillairajah
nathan-thillairajah deleted the dylan/apps-share-visibility-community branch October 29, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants