Skip to content

Grey out opening a private channel that has other members - #3145

Open
loganj wants to merge 5 commits into
mainfrom
loganj/private-open-guard
Open

loganj wants to merge 5 commits into
mainfrom
loganj/private-open-guard

Conversation

@loganj

@loganj loganj commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The relay will refuse to make a private channel or Solo chat open when it has, or had, a member other than you and your own agents (Refuse opening a private channel that has other members buzz#9307). Before this change the app offered Public and View only anyway, and the change failed after you picked one.
  • Now, when the app can tell that such a member is present, it greys out Public and View only with the reason "Has other members. Create a new channel instead." This covers General access in Manage members (channels and Solo chats) and in Convert to channel.
  • Sharing a Solo chat that has another person in it now stops with "This chat has other members, so it can't be shared. Create a new channel instead." It no longer saves an access change the relay would refuse.
  • Private chats and channels that hold only you and your agents can still be opened, as before, except in the one case under Known limitations.

Details

  • The relay decides. The app only predicts what the relay will do, and it greys out the options only when it has evidence:
    • A member whose verified owner is someone else blocks, even if your agent list includes it.
    • Otherwise, a member that is in your agent list is yours.
    • A member whose profile has loaded with no agent tag counts as a person and blocks, but only once your agent list has fully loaded.
    • A member whose profile has not loaded, or an agent with no verified owner, does not block. If the relay refuses, the existing error appears.
  • Known limitations:
    • If one of your own agents has a profile with no agent tag and is missing from your agent list, the app greys out opening even though the relay would allow it. You can still create a new channel. A relay answer the app can read would remove this guess; that is a separate follow-up.
    • A relay without the rule (for example relay-v0.3.0 and older) would allow an opening that the app now greys out. The relay does not announce the rule, so the app cannot tell.
  • The app sees only current members. If a removed member makes the relay refuse, the options stay enabled and the relay's error appears.
  • The check re-runs when profiles, owner verification or your agent list change. An owner can be verified after the profile loads, and that does not create a new profile snapshot.
  • docs/buzz-help.md explains the rule.

Screenshots

A private channel with another person, in Manage members:

Manage members for a private channel with another person General access menu with Public and View only greyed out

A private Solo chat with another person: Share, then General access:

Solo chat share access Solo chat General access with Public and View only greyed out Solo chat share refused because the chat has other members

The same chat in Convert to channel:

Convert to channel with View only and Public greyed out

Testing

  • Unit tests for the prediction, including an unloaded profile, an unverified agent, an agent list still loading, and owner verification that arrives after the profile.
  • Component tests for General access, Convert to channel and Share. Each ownership rule (verified owner first, agent list, agent flag, Share's check after confirm) has a test that fails if the rule is removed.

🤖 Generated with Claude Code

Human test: skipped by the author for team review (2026-11-17).

buzz-review-completed

@loganj
loganj force-pushed the loganj/private-open-guard branch from 5eb929b to 5a50f27 Compare November 9, 2026 22:53
loganj added a commit to block/buzz that referenced this pull request Nov 16, 2026
## Summary
- Turning a private channel open changes who can read and join it for
everyone who joined while it was private. The relay now refuses that
change when the channel has, or once had, any other member.
- Removed members count too, because their posts stay in the history
that opening would make public.
- Opening is still allowed when every member, current or removed, is the
person making the change or one of that person's agents. A Solo chat
that holds only its owner and the owner's agents is the main case.
- Changing an open channel to private is unchanged.
- A refused change stores nothing. The sender gets: `invalid: a private
channel with other members cannot be made open; create a new open
channel instead`.

## Details
- The check is in the channel metadata edit path (kind:9002), for every
channel type. An agent counts as the sender's own only when its owner is
recorded for it through an owner attestation (NIP-OA). A member who has
never signed in, or an agent with no recorded owner, counts as another
member.
- The check runs under the membership lock that a visibility change
already takes. Members cannot be added between the check and the commit.
- Disclosure levels for agents do not exist yet, so all of the sender's
own agents may stay when the sender opens a channel. When levels land,
restricted writers will need to be excluded.
- `update_channel` in the store does not apply this rule. Only tests
call it. User edits go through kind:9002. Both doc comments say so.
- Old desktop builds can still send an opening edit. They now get the
refusal as an error.
- `NOSTR.md` documents the refusal on the kind:9002 row.

### Related issue
None found. The client UX is in
block/buzz-app#3145.

### Testing
- New Postgres tests in `edit_metadata_postgres_tests.rs` cover: only
the owner, the owner with their agent, the owner's removed agent, a
removed person, another person, a member with no user record, someone
else's agent, an agent sending with its owner as a member, and a
stranger who joined while the channel was open.
- Each refused case checks that the channel stays private and nothing is
stored. The tests fail when the check is removed, when it skips removed
members, or when the user join is made inner.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@loganj
loganj force-pushed the loganj/private-open-guard branch from 5a50f27 to fbc9698 Compare November 17, 2026 02:19
@loganj
loganj marked this pull request as ready for review November 17, 2026 23:15
@loganj
loganj requested a review from a team as a code owner November 17, 2026 23:15

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord recommends changes at fbc9698. Source review only.

Comment thread src/features/solo/ConvertToChannel.tsx Resolved

@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.

🤖 Three P3 documentation and regression-test gaps. No current runtime defect is asserted by the test-coverage findings.

Comment thread docs/buzz-help.md Resolved
@loganj
loganj force-pushed the loganj/private-open-guard branch 4 times, most recently from de0c10e to 7b501be Compare November 23, 2026 13:14
jedwards27

This comment was marked as resolved.

@loganj

This comment has been minimized.

loganj and others added 4 commits November 23, 2026 10:58
The relay refuses to make a private channel or chat open while it has a
member who is neither the person changing it nor one of their own agents.
General access and Convert to channel now disable View only and Public
in that case and say why. Sharing such a Solo chat stops before the
access confirmation with the same reason.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
The opening check can settle after someone picked Public or View only.
General access now disables Change access and shows the reason in the
open confirmation; Convert to channel disables Convert and shows the
reason until Private is picked. Existing attempts keep Check status and
Finish conversion.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
Tests now fail if Manage members stops passing the opening check, if
Convert to channel stops loading member profiles or the agent inventory,
or if either component disables Public and View only on a channel that
is already open. The help text now says former members count too, as
the relay rule does.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
The relay authorizes by the agent's recorded owner. A stale inventory entry
for an agent whose verified owner is someone else no longer lets the UI
offer an opening the relay refuses.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the loganj/private-open-guard branch from 7f9159f to bc7ff81 Compare November 23, 2026 16:01

@jedwards27 jedwards27 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.

⚠️ Needs a desktop and mobile check before merge
Client-side prediction of the kind:9002 private→open rule in block/buzz#9307: check Desktop General access and Solo Share/Convert, and Mobile's reachable channel metadata edit path, against a relay enforcing it. The relay's refusal for a former member is invalid:, not blocked:.

🤖 :bot: Jude’s code review agent — Verdict: COMMENT; recommendation: request changes.

Reviewed: base 5b5f804f299f2d7166549b9989bbb50b7f5dacf3 to exact head bc7ff81c6ba717bac4f13b28857d6f903a8e5ec2 (three-dot PR diff). Risk: medium, user-visible access gating against a relay-owned identity rule.

Blocking finding (P2): src/features/channels/general-access.ts:85–92 treats a loaded profile with no agent marker plus absence from the completed client agent inventory as proof a roster member is human. An agent actually owned by the viewer in the relay's NIP-OA record, but omitted from that inventory and carrying an untagged profile, makes openingBlocked() return true even though the relay would allow opening. This wrongly disables Public/View in General access and Convert to channel and refuses Solo Share before save. The PR itself acknowledges this case while promising own-agent-only chats remain open. The new regression at general-access.test.ts:66–75 asserts the heuristic, not the missing owned-agent counterexample. Author action: do not turn absence of inventory/profile markers into affirmative person evidence; leave unclassified members to relay authorization (or use positive, authoritative evidence), and add the owned-agent/tagless/absent-inventory case alongside human and foreign-owner controls. The revised verified-foreign-owner-before-inventory precedence is sound, but does not solve this case.

Behavior/contracts traced: the predictor, General access late-settling confirmation, Solo Share's pre-save guard, Convert's new-attempt guard and existing-attempt recovery, and relay definitive-refusal propagation. No second author-side defect was established in those paths.

Validation: on a clean exact-head Mac worktree, five affected Vitest files passed 154/154 and pnpm check passed; a direct exact-input exercise returned openingBlocked=true for the tagless omitted owned agent. The changed Solo-sharing browser journey passed 16/16 on Chromium and WebKit with a fixture broker. git diff --check passed. Exact-head CI has CI required and Rust/tool integration green; the prior Rust advisory failure is no longer a gate at this head. The bootstrap helper reported an installed lefthook version below its minimum, so direct Hermit package gates were used.

Manual/native evidence: no exact-head running Desktop, Mobile, or OS VoiceOver test against an enforcing relay. Component AX descriptions and browser fixtures are not native proof. Verification owner: reviewer/tooling for the enforced-relay Desktop human/own-agent/former-member journeys, refusal with no visibility commit, and Mobile's reachable metadata-edit/Members path (Mobile currently exposes no equivalent visibility/share/convert action). Confirm relay deployment before exercising; this is a merge gate, not an additional author defect. Residual risk: live relay version and native AX remain unverified.

Recommendation: request changes for the concrete false-lockout defect above; the cross-client check is separately reviewer-owned.

Add tests that fail if the agent-list check, the profile agent flag, or
Share's check after confirm is removed. The greyed-out reason now says
"Create a new channel instead.", as the Share error does, since it also
shows on View only and in Solo chats.

Co-authored-by: McKeon <72469f4dd6e18e92a1b9af63766f05631a49b5d8f281910351d1728b8ad2dc4a@buzz.block.builderlab.xyz>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>

This branch has not been deployed

No deployments
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.

4 participants