Skip to content

feat: add relay-local reputation provider - #5

Open
branarakic-agent wants to merge 4 commits into
feat/reputation-provider-foundationfrom
feat/local-reputation-provider
Open

feat: add relay-local reputation provider#5
branarakic-agent wants to merge 4 commits into
feat/reputation-provider-foundationfrom
feat/local-reputation-provider

Conversation

@branarakic-agent

Copy link
Copy Markdown
Collaborator

Summary

  • add an explicit disabled | local | dkg reputation-provider selection while preserving existing DKG-trust deployments by default
  • resolve channel-scoped NIP-32 vouches plus the authenticated viewer's exact public NIP-85 30382:<result> selections from the tenant-scoped relay store
  • return normalized buzz-trust-claim@1 evidence with original signed events, lifecycle state, pagination, source diagnostics, and honest complete/partial/unavailable semantics
  • advertise a backend-neutral buzz-reputation@1 capability and let the desktop show a standalone community-trust surface without requiring DKG memory
  • avoid false projection failures on relay-only providers; DKG-enabled communities retain the graph-projection path

Safety and bounds

  • canonical relay membership and channel-read authorization still run before provider resolution
  • host-derived community and server-resolved channel scopes are never client-selectable
  • local reads have a 2-second deadline, 100-claim page cap, 500-event source window, and 32-source NIP-85 cap
  • external NIP-85 relay hints are never fetched server-side; unresolved/private/truncated sources produce partial
  • supersession is accepted only for an existing same-issuer/same-subject replacement
  • disabled, complete, partial, and unavailable providers share one conformance harness

Verification

  • cargo test -p buzz-relay --lib --locked (937 tests; DB/Redis integration cases remain ignored by their existing gates)
  • cargo clippy -p buzz-relay --lib --locked -- -D warnings
  • pnpm --dir desktop test
  • pnpm --dir desktop typecheck
  • focused Biome check for the changed desktop files
  • cargo fmt --all -- --check
  • git diff --check

Stack

Stacked on #4 (feat/reputation-provider-foundation). Only the two M2 commits appear in this PR.

@branarakic-agent branarakic-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review pass completed at adbac26. Two blockers remain in the local-provider delta. First, relayProjectsTrustToDkg checks only the generic memory capability; a relay that advertises memory but not dkg-trust@1 will receive unsupported trust projections that are then retained and retried indefinitely. Require both memory and trust support, while keeping the event-only local-provider path. Second, the local provider returns up to 100 claims with the complete raw Nostr event embedded in every sourceDocument, but this response bypasses the bounded-response path used by the DKG adapter. Valid large events can therefore produce multi-megabyte trust responses and defeat the new bounded-query contract. Cap or omit raw source payloads and enforce a response byte ceiling, with tests near the limit. The branch CI is also currently red.

Signed-off-by: branarakic <branimir.rakic@origin-trail.com>
Signed-off-by: branarakic <branimir.rakic@origin-trail.com>
Signed-off-by: branarakic <branimir.rakic@origin-trail.com>
Signed-off-by: branarakic <branimir.rakic@origin-trail.com>
@branarakic
branarakic force-pushed the feat/local-reputation-provider branch from 8981a80 to e7eabeb Compare August 12, 2026 23:59
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