Skip to content

feat(nip56): hide events matching an actionable report - #788

Open
Priyanshubhartistm wants to merge 2 commits into
cameri:mainfrom
Priyanshubhartistm:feat/nip56-hide-deprioritize
Open

Priyanshubhartistm wants to merge 2 commits into
cameri:mainfrom
Priyanshubhartistm:feat/nip56-hide-deprioritize

Conversation

@Priyanshubhartistm

Copy link
Copy Markdown
Collaborator

Description

Follows up on #770 (NIP-56 content reporting): a report from a trusted moderator was only ever recorded with an actionable: true flag, nothing acted on it. Adds nip56.hideActionableReports (default false) when enabled alongside nip56.enabled, events matching an actionable report are excluded from REQ/COUNT results. A pubkey-targeted report hides every event from that pubkey; an event-targeted report hides just that event. Off by default, so turning on reporting alone never changes what existing subscribers see.

Motivation and Context

The NIP-56 scope this was built against calls for trusted-moderator reports to "trigger automatic actions (hiding content, deprioritizing in queries)." Recording the flag without acting on it left that half of the scope unimplemented.

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@changeset-bot

changeset-bot Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bdb1cd8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Critical risk] Database schema change and event filtering logic for content moderation.

The PR should not merge until live subscriptions enforce the same hiding rule as stored-event queries.

Findings

  1. P1 Live subscriptions bypass report hiding ▶
Summary

Adds an opt-in NIP-56 setting that excludes events matched by actionable reports from stored-event REQ results and COUNT results.

  • Adds settings, documentation, partial report indexes, and SQL-generation tests.
  • Live subscription delivery does not apply the new exclusion.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  R[New REQ or COUNT] --> Q[EventRepository query]
  Q --> X[Exclude actionable-report matches]
  B[New event broadcast] --> L[Live subscription filter]
  L --> D[Send event without report check]
Loading

Reviews (1) · Last reviewed commit: "feat(nip56): hide events matching an act..."

Comment thread src/repositories/event-repository.ts
@coveralls

coveralls commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 72.57% (+0.1%) from 72.459% — Priyanshubhartistm:feat/nip56-hide-deprioritize into cameri:main

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.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.

2 participants