Skip to content

[CI verification only] fix(relay): materialize NIP-OA owner for direct relay members - #1

Closed
rclod wants to merge 2 commits into
mainfrom
fix/nip-oa-owner-for-direct-members
Closed

[CI verification only] fix(relay): materialize NIP-OA owner for direct relay members#1
rclod wants to merge 2 commits into
mainfrom
fix/nip-oa-owner-for-direct-members

Conversation

@rclod

@rclod rclod commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Fork-internal PR to run CI before opening the real PR against block/buzz. Not for merge; tracks block#6072.

rclod added 2 commits August 16, 2026 14:04
… members

The agent→owner backfill ran only when `require_relay_membership` was false. On
a closed relay it never ran, and `enforce_relay_membership` does not fill the
gap: it reports an owner only when it USED the delegation to admit the agent
(`MembershipDecision::ViaOwner`). An agent that is also a direct relay member
takes the `::Member` branch, which returns `Ok(None)` and discards a perfectly
valid, cryptographically self-proving attestation.

The result is that on a closed relay, any agent enrolled directly in
`relay_members` has `users.agent_owner_pubkey` left NULL no matter what it
sends. That column is not cosmetic — three behaviours derive from it:

- `is_agent` in the admission path is `agent_owner_pubkey.is_some()`, so such
  agents are rate-limited at `human_messages_per_min` (60) rather than
  `agent_standard_messages_per_min` (120)
- owner-managed agent lists have no relationship to display, so the agent is
  absent from them while still being DM-able
- `channel_add_policy = "owner_only"` has no owner to compare against, so
  `add-member` fails with "policy:owner_only — agent has no owner set" for
  every actor, including the real owner

Extraction now runs whenever an `auth` tag is present, independent of how
membership was satisfied. No feature flag is needed, for the reason already
documented on `extract_nip_oa_owner`: NIP-OA is cryptographically self-proving,
so the tag's own verification is the security boundary — and that verification
is unchanged.

Also corrects two doc comments that described the old open-relay-only behaviour.

Observed on a self-hosted closed relay (BUZZ_REQUIRE_RELAY_MEMBERSHIP=true) with
an agent present in `relay_members` and sending a valid NIP-OA tag on its NIP-42
AUTH event: "NIP-42 auth successful" was logged, no materialization was
attempted, and `agent_owner_pubkey` stayed NULL.

Signed-off-by: rclod <3385524+rclod@users.noreply.github.com>
Dropped before the PR is opened.

Signed-off-by: rclod <3385524+rclod@users.noreply.github.com>
@rclod

rclod commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

CI verified green (run 31967009636, 21 passed). Upstream PR: block#6078.

@rclod rclod closed this Aug 16, 2026
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.

1 participant