Repository navigation
Conversation
…njection-guard
|
@Ire12 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
Merge conflict with Pushed merge commit Conflicting file(s) resolved:
The pull request is mergeable again — CI will re-run on the new head. @MaryammAli ready for review and merge when you have a moment. |
Ire12
force-pushed
the
feat/846-moderation-hooks-governance
branch
from
October 8, 2026 18:17
f680d45 to
76f23d2
Compare
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.
Overview
Implements BE-093 — moderation hooks & governance integration for the social feed (
BackendAcademy). Posts and comments can be flagged through a REST surface, a flagged target is hidden pending review, every state change is appended to an immutable audit trail, and the decision itself is delegated to a pluggableContentVerdictHookso the future on-chaingovernancecontract can vote on content without BE-093 depending on it.Related Issue
#846 — BE-093 — moderation hooks & governance integration
Changes
Moderation surface
[ADD]
BackendAcademy/src/social/content-moderation.service.tsreport()files aContentReportand moves the target tohiddenin the same call, so abusive content stops being served before anyone reviews it.getQueue()exposes open reports;isVisible()/filterVisible()are the read-side guard.registerVerdictHook()+adjudicate()consult hooks in registration order and apply the first verdict:restorereturns the content tovisible,removeleaves itremoved.getAuditTrail()returns the append-only trail (reported→hidden→restored/removed), each entry carrying actor, action, timestamp and report id.[ADD]
BackendAcademy/src/social/dto/report-content.dto.tstargetKind(post|comment),targetId,reporterId,reasonanddetails.[ADD]
BackendAcademy/src/social/content-moderation.service.spec.ts[MODIFY]
BackendAcademy/src/social/social.types.tsModerationTargetKind,ModerationState,ContentReport,ModerationAuditEntry,ModerationVerdictandContentVerdictHook.[MODIFY]
BackendAcademy/src/social/social.controller.tsPOST /social/reports,GET /social/moderation/queueandGET /social/moderation/audit.filterVisible, so hidden content is never returned.[MODIFY]
BackendAcademy/src/social/social.module.tsContentModerationService.Verification Results
report()moves the target tohiddenimmediately;filterVisible()guards the feed, showcase and hashtag read pathsgetAuditTrail()entries recording action, actor, timestamp and report idPOST /social/reportswithtargetKind: post | commentGET /social/moderation/queuereturns open reportsgovernancecontract votingContentVerdictHookregistered viaregisterVerdictHook(), applied byadjudicate(); content stays hidden while every hook abstainsUnit tests were added but not executed here — this session had no checkout of the repo and was API-only, so no green run is claimed.
Closes #846