feat(acp): publish kind:10100 agent directory profile - #4713
Open
dexsynccom wants to merge 2 commits into
Open
Conversation
Clients already consume kind:10100 for mention eligibility (desktop list_relay_agents, mobile agentDirectoryProvider) and the relay ingests it with a users-table side effect, but nothing ever published it — so an agent's respond_to/allowlist policy and channel set were invisible to other users' clients, and respond_to=anyone had no effect on who could see the agent in mention autocomplete. Publish the profile at the presence-online readiness boundary and republish whenever a membership notification changes the subscribed channel set. Content carries the cross-client contract fields: respond_to, respond_to_allowlist, channel_ids, channel_add_policy. Discovery metadata only — the author gate (author_allowed) remains the enforcement point. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: dexsynccom <rifai@dexsync.com>
kind:10100 is replaceable and `buzz channels set-agent-policy` writes the same kind carrying only channel_add_policy. The directory publisher hardcoded "anyone", so every restart or membership change silently reset an operator's stricter policy (owner_only/nobody) — a security-loosening regression. Resolve the advertised value from BUZZ_ACP_CHANNEL_ADD_POLICY, defaulting to the relay's own column default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: dexsynccom <rifai@dexsync.com>
dexsynccom
force-pushed
the
fix/agent-mention-eligibility
branch
from
August 13, 2026 07:37
9e249b0 to
0ddff55
Compare
wolfyy970
suggested changes
Aug 13, 2026
wolfyy970
left a comment
There was a problem hiding this comment.
Publishing from the running harness is the right ownership boundary, but this head is not safe to merge yet.
- The
channel_add_policyfix does not preserve an operator's saved choice.buzz channels set-add-policypublishes the policy but never setsBUZZ_ACP_CHANNEL_ADD_POLICY. On the next harness start, this code defaults toanyoneand writes that value back into the relay database. It still loosensowner_onlyornobody. - The two commands remain incompatible whole-document writers. The CLI replaces the directory profile with policy-only JSON; the harness replaces it with directory JSON plus whatever policy its process happened to start with. Directory state and channel-add policy need separate authority. The smallest relay change is to treat an absent policy as “leave the stored policy unchanged,” then let the harness omit it.
- Every membership notification awaits a profile publish in the main event loop. Add and remove in the same second can race Nostr replaceable-event ID ordering, leaving the older channel set as the relay head, and a slow HTTP publish pauses event consumption. Debounce/coalesce refreshes and verify the submitted profile became the current head.
- For externally hosted agents, this newly publishes the exact respond-to allowlist community-wide. That membership is an access-policy detail, not directory metadata. Keep it in the private policy boundary and advertise only enough public state for routing.
#5546 is solving the same producer seam. I would consolidate on one implementation rather than land two profile publishers with different policy and refresh behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Publishes the kind:10100 agent directory profile from the ACP harness. Nothing in the tree ever published one, so the directory was permanently empty — while desktop and mobile both consume it for mention eligibility and the relay ingests it with a users-table side effect.
Rebased onto current
main; scope reduced. This PR originally also carried a desktop-side mention-gate fix. #4913 has since landed and supersedes that half with a more thorough implementation (exact-channel authorization, fail-closed DM/context handling, cached-row reauthorization), so the desktop commit is dropped.That makes this PR the enabling half of #4913:
getMentionableAgentPubkeysadmits relay agents viarelayAgentCanRespondInChannel, which readsrespond_to,respond_to_allowlist, andchannel_idsfrom kind:10100. With no publisher, that path can never admit anyone — a harness-run agent stays invisible in mention autocomplete to everyone except its own owner (who is admitted via the managed-agent set instead).Changes
feat(acp): publish kind:10100 agent directory profilechannel_idsreflects the live set) and republishes on membership-notification changes in both directions.agents_from_events(desktop) andAgentDirectoryEntry.fromEvent(mobile):respond_to,respond_to_allowlist,channel_ids,channel_add_policy. Collections are normalized and sorted so republishes are deterministic.author_allowedremains the enforcement point, and clients should treat this as advisory.fix(acp): don't clobber operator channel_add_policy on republishbuzz channels set-agent-policywrites the same kind carrying onlychannel_add_policy. A hardcoded value would silently reset an operator's stricterowner_only/nobodyback toanyoneon the next restart or membership change.BUZZ_ACP_CHANNEL_ADD_POLICY, defaulting to the relay's own column default.Validation
just cigreen on the rebased branch.respond_tostrings clients compare, and the policy override.ptag and the agent never saw the message (its#p-filtered subscription never matched).🤖 Generated with Claude Code