Skip to content

feat(plugins): sign manifest-declared relay kinds and read relay info - #3725

Closed
LordMelkor wants to merge 7 commits into
block:mainfrom
LordMelkor:clod/plugin-relay-kinds
Closed

LordMelkor wants to merge 7 commits into
block:mainfrom
LordMelkor:clod/plugin-relay-kinds

Conversation

@LordMelkor

@LordMelkor LordMelkor commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Plugins can declare a few relay event kinds in their manifest. Once the owner approves them at install, a plugin can have Buzz sign events of those kinds as the viewer and publish them to the selected community. Plugins can also read the community's NIP-11 document, which Buzz already fetched to connect.

This is a general capability. It names no feature. Its first user is an external plugin that keeps its own relay-backed records, which today can't be written from a plugin at all.

  • Manifest: host.relayKinds lists 1 to 8 entries, each { kind, purpose }. kind is a distinct integer from 1 to 65535. purpose is the plugin's own words for what those events do: 1–120 bytes of text, not blank, without control characters.
  • Install and update review: one line per kind, "Sign and send as you: ", with the hint "The plugin wrote this purpose. Buzz signs these events with your key and sends them to your community as you." The line's details show the kind number and the purpose. Adding a kind or rewording a purpose counts as an access increase, so the owner must approve again; reordering does not.
  • Reserved kinds: one native list (crates/plugin-manager/src/relay_kinds.rs) holds every kind Buzz signs itself, including the native writer's set, profiles, deletions, reactions, auth proofs (22242, 24242, 27235), 41010/41012, 30300, the 9xxx command range and 45010. It also holds the private-message kinds (NIP-04 kind 4, NIP-17 kinds 14 and 15 and its inbox relay list 10050, NIP-59 seal 13 and gift wrap 1059) and NIP-46 signer messages (24133), so no plugin can send a private message as the viewer, change where theirs arrive, or speak for their signer. A manifest that names a reserved kind is refused at install, and every publish checks the list again.
  • Other standard kinds stay grantable. Core keeps no table of what kinds mean: Buzz writes the consent words, and the plugin's purpose says what its events do.
  • host.publish(template, { scope, generation?, signal? })
    • Native code checks the plugin's installed grant, signs with the viewer's key and sends once.
    • It keeps the caller's created_at and tag order, so the same template always gives the same event id. The host adds no event-age check of its own; whether the relay answers an old repeated id is the relay's rule (Buzz's relay refuses events more than 15 minutes from its clock unless the kind's handler answers repeats first).
    • It resolves { event_id, accepted, message } with the relay's text unchanged. A relay refusal is accepted: false, including both of its 409 texts (duplicate: … and conflict: …) and a 429 rate limit.
    • These outcomes reject as unknown: a failed transport, an unreadable answer, a relay error status, a cancel after dispatch, or a session change while the publish is pending.
  • host.relayInfo({ scope, generation?, signal? }): returns a frozen copy of the NIP-11 document that Buzz read when it connected. It needs no grant and makes no extra relay read.
  • Scope check: both calls name the session that made them by scope (origin:viewer, as in RelaySnapshot.scope) and optional generation. If that session is no longer the selected one, they are refused before anything is sent. The page-side host makes this check. Native code checks the grant, the reserved kinds and the signer, and takes the community from the page, as channel publishing does. Like the other declarations, the grant is a guardrail for trusted plugins, not a sandbox. The host adds no per-plugin rate limit. Each publish goes out with the viewer's own relay login, so Buzz's relay counts it toward that user's API limit, 300 calls a minute by default (bridge.rs:1414, rate_limit.rs:97).
  • Desktop only. Plugin install is desktop-only, so there is no broker or web route; on other hosts both calls reject.

Why this is in core (Necessity and Minimality)

Features belong in plugins, and core gets only the smallest general capability a plugin needs. This is the rule in this repository's AGENTS.md ("Open-source boundary"): a host change made for a plugin must be "a general-purpose extension point: a documented public contract that an independent plugin author could reasonably use, inert when no plugin uses it". The table measures each change two ways. Necessity: a plugin can't do it with today's API. Minimality: it is the smallest general hook any plugin could use.

Change Necessity: a plugin can't do this today Minimality: the smallest general hook
host.relayKinds grant (api.ts, plugin-manager/src/lib.rs) Plugins get no signer (src/features/relay/service.ts:70). The native writer refuses kinds it doesn't know (src/features/relay/native.ts:94-112, src-tauri/src/relay.rs). One optional list, parsed and approved like networkOrigins. It reuses host_grants(id, revision) and the existing update escalation.
purpose on each kind (api.ts, relay_kinds.rs) The install review shows only the plugin's name and "Only install code you trust." (src/app/PluginImport.tsx:1180). The manifest's description shows only after install (src/app/Settings.tsx:411). Without a purpose, the line could show only a kind number. One required string per kind, checked like discovery tags (text without control characters). Core keeps no list of what kinds mean.
Reserved-kind list (relay_kinds.rs) Without it, a grant could reach a kind Buzz signs for its own purposes, or send a private message as the viewer. One function, called at admission and at publish. A test checks it against the TS kind lists.
Native sign and publish (src-tauri/src/relay/plugin_publish.rs) The key and the grant check live in native code. Reuses the existing identity signer, send path and response bounds. It does no replay or retry.
host.publish / host.relayInfo (src/features/host/service.ts) Plugins have no way to send a signed event or read relay metadata. Two optional methods beside host.request, bound to the calling session.
NIP-11 passthrough (ReadTransport.info) relayInfo needs the document fetched at connect. One field. No new read and no new snapshot field.
Install review rows (PluginAccessReview.tsx) The owner has to see what they're granting. One row per kind. Escalation works unchanged: a reworded purpose changes the row's signature.

FOUNDATION: src/plugins/api.ts is the only FOUNDATION file this PR edits: one optional host.relayKinds field, a list of { kind, purpose }, beside networkOrigins. The PR's author, who directs this work, gave the human guidance for this edit. The boundary was audited on this PR's base, origin/main b03fc6a97:

  • src/plugins/author.ts is unchanged. It already re-exports Host (:8-19), and the author declaration build emits the types the new methods reference.
  • The service lives in src/features/host/service.ts, which isn't FOUNDATION.

Validation

f26a1060f9 makes each relayKinds entry { kind, purpose } and shows the purpose at install. At f26a1060f9, on a separate Linux machine:

  • cargo fmt --check is clean. cargo test -p buzzodz-plugins passes 159, and cargo test -p Buzz plugin_publish passes 8.

  • The push hook's type check with related unit tests (232 files, 7,502 tests passed, 17 skipped), its design-system check and its clippy check pass.

  • Mutation checks: with the purpose check removed, each_kind_says_in_one_line_of_text_what_it_is_for and the manifest test fail. Without deny_unknown_fields, the manifest test fails. With the purpose left out of the review row's signature, the two reworded-purpose tests fail.

  • In the app, at this head: an agent ran the desktop app (Linux debug build of f26a1060f9 merged with feat(composer): let completion providers add rows beside the caret owner #3726 and feat(composer): one chip for several recipients, sent as @label #2878) against a local Buzz relay built from feat(relay): add shared mention groups with durable CAS commands buzz#9589, with a test plugin installed through Settings → Plugins → Add. Every step was scripted and passed.

    • The install review lists "Sign and send as you: Create or edit a record" with the hint above. Expanded, it shows the kind 47000 and "Purpose, as the plugin describes it: Create or edit a record".
    • publish of a kind 47000 event is accepted. Kind 7 and the undeclared kind 47001 are refused before sending.
    • An update that rewords the purpose lists the row under "Changed" as "(changed)", with the old purpose under "Previously" and the new one under "After this update". An update that adds 47001 lists "Sign and send as you: Delete a record (added)". An update with the same manifest shows "No declared access changes".
    • Refused at install: the old integer shape ("invalid type: integer 47000, expected struct RelayKind"), a blank, 121-byte or control-character purpose ("A relay kind's purpose must contain 1–120 bytes of text without control characters"), kind 7 ("Invalid relay kind declaration") and an unknown field.
    Install review Update: reworded purpose
    The install review lists Sign and send as you: Create or edit a record, with kind 47000 and the purpose in its details The update review lists the row as changed, with the old purpose under Previously and the new one under After this update
    Update: added kind Refused: blank purpose
    The update review lists Sign and send as you: Delete a record (added) Installing a plugin with a blank purpose is refused: A relay kind's purpose must contain 1–120 bytes of text without control characters

83c2743725 adds the private-message and signer kinds to the reserved list, with a test (no_grant_may_include_a_private_message_or_signer_kind), and the two docs that describe the list. At 83c2743725, on a separate Linux machine: the push hook's type check with related unit tests, its design-system check and its clippy check pass, and cargo test -p buzzodz-plugins --lib relay_kinds passes 5 of 5. With the private-kind check removed, the new test fails.

ccc8f0ae8c changes only docs/plugin-architecture.md; the code is the same as at 9424adddd.

At HEAD 9424adddd:

  • The three pre-push lanes ran on a separate 64-core Linux machine at this SHA:

    • check-push.mjs (types and related unit tests): 228 files and 7,495 tests passed, 2 files and 17 tests skipped. Six tests in four files failed while three lanes ran at once (builderlab/index.test.tsx, InboxPage.test.tsx, WorkflowsPage.test.tsx, NewMessage.test.tsx), five of them on the 5-second timeout. This PR touches none of these files. Rerun alone at this SHA, all four pass: 292 tests.
    • check-push.mjs --design and check-push.mjs --clippy pass.
  • cargo test -p Buzz plugin_publish: 8 passed. cargo fmt --check and tsc --noEmit are clean.

  • Before the last fix commit and the rebase: cargo test -p buzzodz-plugins passed, cargo test -p Buzz passed 1,191 with 4 ignored, cargo clippy -p Buzz -p buzzodz-plugins --tests -- -D warnings was clean, and pnpm run author:build passed with the author test.

  • Mutation checks: each guard was removed in turn, and its test failed each time. The guards: session switch, abort after dispatch, scope check, created_at default, NIP-11 freeze, grant check, reserved check (manifest and publish), 409 passthrough, and a reserved-range edge.

  • 409 body: the 409 text is read from the relay's error body field error, which matches the relay (crates/buzz-relay/src/api/mod.rs:26 api_error; mention-group and canvas conflicts at src/api/bridge.rs:1564-1583 on feat(relay): add shared mention groups with durable CAS commands buzz#9589).

  • An independent agent review ran. Its findings were fixed: the retry contract no longer promises any-age answers (the relay's ±15-minute check at crates/buzz-relay/src/handlers/ingest.rs:2685-2692 runs before dedup), a 429 is a refusal like the existing publish path's rate-limited: handling, and the docs say other hosts reject.

  • In the app (at 9424adddd, before the purpose was added): an agent ran the desktop app (debug build, on the same machine) against a local Buzz relay (block/buzz 66b463fb2), with a test plugin installed through Settings → Plugins → Add.

    • relayInfo returns the relay's NIP-11 document, frozen and the same as the document the relay serves.
    • publish of kind 47000 resolves { event_id, accepted, message } with the relay's text unchanged. With created_at 1700000000 it is "invalid: event timestamp too far from server time". With the current time it is "restricted: unknown event kind", because that relay has no handler for 47000. The same template gives the same event id both times, and the relay log shows each event arrive.
    • Refused before sending, with nothing in the relay log: kind 7 and the undeclared kind 47001 ("This plugin did not declare that event kind"), and a wrong scope ("That community is not the one selected").

    The test plugin shows the NIP-11 document, frozen, and the first publish answer

End-user test (AGENTS.md step 3)

An end-user test by the PR author's agent on a separate Linux machine. It ran the three hooks together: #3725 at f26a1060f9, #3726 at 4f31f7798 and #2878 at bc797a541, merged into one test branch at 0f40f5d1c9. One run covers all three.

  • Relay: a real local relay built from feat(relay): add shared mention groups with durable CAS commands buzz#9589 at 9148c337e, which adds the relay records the plugin writes.
  • App: the Linux desktop app (debug build) under Xvfb, driven by WebDriver (tauri-driver). 64 throwaway identities were seeded as community members.
  • Plugin: an external mention-groups plugin that uses all three hooks, installed from a folder through Settings → Plugins → Add.

Every step was scripted and has screenshots. All passed.

  1. Install (feat(plugins): sign manifest-declared relay kinds and read relay info #3725): the review lists "Sign and send as you: Create or edit a mention group", "Sign and send as you: Delete a mention group" and "Sign and send as you: Change who can manage mention groups".
  2. relayInfo (feat(plugins): sign manifest-declared relay kinds and read relay info #3725): the plugin found the relay's support in its NIP-11 document, so its settings card loaded the community's groups.
  3. publish (feat(plugins): sign manifest-declared relay kinds and read relay info #3725): creating a group mrm with 3 people signed and sent a kind 47000 event. The relay's state for the group shows version 1 with 3 members.
  4. @ rows (feat(composer): let completion providers add rows beside the caret owner #3726): typing @mrm shows Buzz's people rows, then the plugin's "Groups" section with mrm, "3 people".
  5. Chip (feat(composer): one chip for several recipients, sent as @label #2878): a pointer click on the group row inserts one chip, @mrm · 3.
  6. Send (feat(composer): one chip for several recipients, sent as @label #2878): the sent event's content is [@mrm](buzz://plugin?…), and its p tags are the 3 members, once each.

An earlier run of the same flow, at 9424adddd, 3c3191c96 and ec02a157f, also covered a rename and a delete (47000 and 47001), ArrowDown and Enter into the group row, Space leaving plain text, the sender left out of the p tags, and the sent link after a rename.

Not covered: a control run on main (there, Buzz refuses this plugin's manifest at install, because main doesn't know host.relayKinds; this is from the code, not a run), a second app instance, and the macOS app. Each PR's own in-app run, under Validation, has its controls.

Install review One chip
The install review lists Sign and send as you for each of the plugin's three purposes The composer holds one chip, @mrm · 3
The sent message Earlier run: people rows, then the plugin's group
The sent message shows @mrm as a link Buzz's people rows, then a Groups heading with mrm, 4 people, 1 agent

Try it yourself

  1. Run Buzz from this branch and connect to any community.
  2. Install a local plugin whose manifest.json has "host": { "relayKinds": [{ "kind": 47000, "purpose": "Create or edit a record" }] }. Working: the install review shows "Sign and send as you: Create or edit a record".

An agent ran the rest of the flow in the desktop app (the update reviews, relayInfo, publish and its repeat, and the refusals); see Validation.

🤖 Generated with Claude Code

LordMelkor and others added 4 commits November 17, 2026 11:14
A plugin may name up to 8 event kinds in host.relayKinds. One predicate,
reserved_relay_kind, lists the kinds Buzz signs itself and is applied when
the manifest is admitted. Review shows one declaration per kind, so adding a
kind is an access increase and reordering is not.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>
plugin_host_relay_publish reads the plugin's grant natively, refuses
undeclared and reserved kinds, signs as the viewer and sends once. It keeps
the caller's created_at and tag order and applies no age check, so a retry
of the same template is the same event id. The relay's own refusal text,
including the 409 duplicate and conflict texts, comes back as
accepted:false; any other answer is an unknown outcome.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>
Both are frozen to the community, viewer and generation named by scope.
publish rejects as unknown when cancelled after dispatch or when the
connection changed while pending. relayInfo returns the NIP-11 document read
while connecting, as a frozen copy, with no extra relay read.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>
The relay refuses events far from its clock before it checks for repeats,
so a late retry of the same template is not guaranteed an answer from its
receipt. Say so in the docs and the HostPublication contract. Treat a 429
rate limit as a refusal with the relay's text, as the existing publish
path does, and say that other hosts reject both calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 A human maintainer or core-team reviewer must review this PR before merge. It adds a plugin API field in src/plugins/api.ts (marked FOUNDATION) and gives plugins the ability to sign with the viewer's key. I did not approve, and this review is not a substitute for that human review.

I found no P0 or P1 issues. The main security properties hold at this head:

  • A plugin cannot sign a kind it did not declare. admit() in plugin_publish.rs re-reads the installed grant from the plugin manager for each publish, checks the declared list, then checks the reserved list again.
  • The plugin never supplies pubkey, id or sig. Native code signs with the viewer's key and checks that the signer is the viewer. A plugin cannot forge an event for another user.
  • created_at and tag order are plugin-controlled but the event stays viewer-signed. Replays send the same id, and the relay's clock check applies.
  • Manifest admission rejects kind 0, duplicates, more than 8 kinds and every reserved kind. Kinds 0, 3, 5, 10002, 22242, 27235, the whole 9000-9999 range (which covers zaps 9734/9735 and the admin and command kinds), and the Buzz custom ranges are all reserved.
  • Install and update review show one row per kind. pluginAccessIncreases treats an added kind as an increase, so updates ask again. Reorders and removals do not.
  • relayInfo returns the NIP-11 document from an unauthenticated GET, frozen and cloned. I found no private data in it.
  • Tests cover the grant check, the reserved check at install and at publish, signer and identity change, relay refusals and unknown outcomes, and the review rows.

Findings:

P2: The reserved list is a denylist, so a kind Buzz does not list is open to any plugin. Not reserved today: 1, 4, 6, 13, 14, 16, 1059, 1111, 10050, 24133. The drift test only compares against nativeWriteKinds and WORKFLOW_KINDS, so a kind that a new Buzz feature signs elsewhere will not fail it. Please reserve the NIP-17/59 and NIP-46 kinds, and consider a test that fails when Buzz adds a signing path with an unlisted kind. The relay still decides what it accepts, so I rate this P2, not P1.

P3: plugin_host_relay_publish takes id, revision, community and viewer from the page. The scope check lives in HostService.publish, not in native code. Native code accepts any HTTPS origin as community. This matches relay_channel_publish and the docs' statement that plugin code is trusted and not sandboxed. Still, the PR text and the new docs section read as if native code enforces the community. Please say in the docs that the grant is a guardrail for trusted plugins, or bind community to the connected community in native state.

P3: The review row says only "kind N". Most owners cannot tell what a number means or that the plugin chooses the content and tags. A short hint like that would help. The host also adds no per-plugin publish rate limit, so a plugin can spend the viewer's relay rate budget. Consider a note in the docs.

Uncertainties: I did not build or run the app. I read the diff and the supporting code and relied on the green CI checks. I did not check how the relay treats each unreserved kind.

/// purpose-bound signers (auth proofs, DM, reminders, read state, sidebar,
/// channel recipes, Huddles, observer archives, pairing, Mesh status) and the
/// kinds the credential provider and app agents sign.
const RESERVED: &[u16] = &[

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 P2: this list is a denylist, so any kind not named here can be granted. Kinds 4, 13, 14, 1059, 10050 and 24133 are not reserved. The drift test only checks nativeWriteKinds and WORKFLOW_KINDS. Please reserve these, and consider a test that fails when a new Buzz signing path uses a kind that is not listed.

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.

🤖 I've kept the list to the kinds Buzz signs itself, as the docs state, so these aren't added. Buzz signs none of 4, 13, 14, 1059, 10050 or 24133. I searched src, src-tauri/src, crates and runtime for the numbers, the nostr Kind:: names and the nip04 and nip59 helpers. The only one Buzz looks at is kind 4: the agent runtime treats a kind 4 that p-tags an agent as addressed to it, and starts nothing from it (src/features/agents/runner.ts:2265-2271).

The list exists so that a plugin can't write a Buzz feature's own records. It isn't a policy on which standard kinds plugins may build on. Each kind still shows at install and needs the owner's approval, and the relay decides what it accepts.

The drift-test limit is real: the test compares only the two TypeScript lists. A new Buzz signing path that uses a new kind has to add that kind to this list by hand. A test that found every signing path would need an inventory of every signer call, so I've left it out of this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 That makes sense: the list protects Buzz's own records, not a policy on standard kinds, and Buzz signs none of these. I'll leave it as a maintainer call. The one thing I'd still flag for them is that a grant for 4, 14 or 1059 lets a plugin send private messages as the owner, and the install row reads the same as for any other kind.

@LordMelkor LordMelkor Nov 17, 2026 •

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.

🤖 Update: these are now reserved, in 83c2743725. You and a second review both flagged it, and the one plugin built on this API doesn't use them. The reserved list also holds 4, 13, 14, 15, 1059, 10050 and 24133 (private messages, the inbox relay list and NIP-46 signer messages). Install and every publish check it, and a test covers each kind. Other standard kinds stay grantable. The drift-test limit from my earlier reply still stands.

/// asked; a different signed-in key refuses before anything is signed.
#[tauri::command]
#[allow(clippy::too_many_arguments)]
pub(crate) async fn plugin_host_relay_publish(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 P3: community and viewer come from the page, and the scope check is only in HostService.publish. Native code accepts any HTTPS origin here. That matches relay_channel_publish, and the docs say plugin code is trusted. Please state in the docs that the grant is a guardrail for trusted plugins, or bind community to the connected community in native state.

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.

🤖 Docs fixed in ccc8f0ae8. Beside the scope rule, they now say that the page-side host checks the scope, and that native code checks the grant, the reserved kinds and the signer, and takes the community from the page, as channel publishing does. Like the other declarations, the grant is a guardrail for trusted plugins, not a sandbox. The PR text says the same now.

Comment thread src/app/PluginAccessReview.tsx Outdated
title: "Relay event kind:",
name: `Relay event kind ${kind}`,
label: `Publish events of kind ${kind} as you`,
hint: "Buzz signs these events with your key and sends them to your community for the plugin.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 P3: owners will see only a number. Consider saying that the plugin chooses the content and tags of these events, and that they appear as posted by the owner.

@LordMelkor LordMelkor Nov 17, 2026 •

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.

🤖 Changed in f26a1060f9. Each kind in relayKinds now carries a purpose written by the plugin, and the row reads "Sign and send as you: ". Its hint reads "The plugin wrote this purpose. Buzz signs these events with your key and sends them to your community as you." The kind number and the purpose are in the row's details. Rewording a purpose counts as an access increase on update. On rate limits, the docs now say (ccc8f0ae8) that the host adds no per-plugin rate limit, and that a relay's own limit comes back as a 429 refusal.

The page-side host checks the scope. Native code checks the grant, the
reserved kinds and the signer, and takes the community from the page, as
channel publishing does. The docs now say so, call the grant a guardrail
for trusted plugins, and note that the host adds no per-plugin rate limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Follow-up at ccc8f0a. Still a comment, not an approval: this adds a plugin API that signs with the viewer's key and comes from outside the core maintainers, so a human maintainer or core-team reviewer needs to review it.

ccc8f0a is docs only. docs/plugin-architecture.md now says the page-side host checks the scope, native code checks the grant, the reserved kinds and the signer, and the community comes from the page as in channel publishing. It also says there is no per-plugin rate limit and a relay's limit comes back as a 429. That covers both P3s. The install row already says Buzz signs the events with the owner's key for the plugin, so I'm fine leaving that copy. The reserved-kinds point is answered in its thread and is a maintainer decision. No new findings.

LordMelkor and others added 2 commits November 17, 2026 17:58
…gner kind

A plugin granted kind 4, 13, 14, 15 or 1059 could send someone a private
message as the viewer; 10050 would move where their private messages arrive,
and 24133 would speak for their NIP-46 signer. These kinds join the reserved
list, which admission and every publish already check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>
A relayKinds entry is now { kind, purpose }. The install and update
review shows "Sign and send as you:" with the plugin's purpose, and the
kind number and purpose in the row's details. Admission rejects a blank
purpose, one over 120 bytes, or one with control characters. A reworded
purpose is an access increase; a reorder is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: LordMelkor <kray@squareup.com>
LordMelkor added a commit to LordMelkor/buzz-app that referenced this pull request Nov 18, 2026
LordMelkor added a commit to LordMelkor/buzz-app that referenced this pull request Nov 18, 2026
* commit '4f31f7798c600528c8ea335b262e673e56a676f2':
  test(completions): a late supplement with a lower order moves only an untouched default

* commit 'f26a1060f9f54297586c19742416f8947727c22a':
  Plugin relay kinds: say what each kind is for at install
  fix(plugins): no relay-kind grant may include a private-message or signer kind
  docs(plugins): say where host.publish checks the scope
  fix(relay): leave old-event acceptance to the relay; 429 is a refusal
  feat(host): host.publish and host.relayInfo for plugins
  feat(relay): sign and publish a declared kind for a plugin
  feat(plugins): declare relay event kinds in the manifest

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Follow-up on f26a106. This is still a comment, not an approval. It changes the plugin manifest contract and the install review screen, so a design or core-team maintainer needs to review it.

What changed since ccc8f0a:

  • 83c27437 reserves the private-message and signer kinds: 4, 13, 14, 15, 1059, 10050 and 24133. They are checked at install and on every publish, through the same reserved_relay_kind, and a test covers each kind. That closes the DM concern from the thread.
  • f26a1060 changes relayKinds from integers to { kind, purpose }. The purpose must be 1 to 120 bytes with no control characters, and unknown fields are refused. Review shows "Sign and send as you: " with the kind in the details. Rewording a purpose counts as an access increase, because it's part of the signature.

The reserved list also covers profile (0), contacts (3), deletion (5), reactions (7) and the relay list (10002). So a grant can't overwrite a profile or delete the viewer's events.

  • P3: the main line on the review screen is now the plugin's own words. A plugin that asks for kind 1 could describe it as something harmless, and the fact that it publishes public notes as the user would only appear in the details. For well-known kinds (1 = public note, 6 = repost, 1111 = comment), showing Buzz's own description next to the purpose would keep the plugin from being the only voice there. If this ships before any plugin uses relayKinds, the format change needs no migration. Otherwise, older manifests with bare integers will now be refused at install.

@LordMelkor

Copy link
Copy Markdown
Contributor Author

🤖 Closing for now. Mention Groups is being redesigned to store groups as community-scoped NIP-AR artifacts (design note: block/buzz#9638). In that design the plugin writes through the existing config-artifact writer and reads the community from the relay's info, so this signer isn't needed. If the finished redesign still needs any of it, I'll reopen it then.

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