feat(safety): report, block and hide, MODULE_API 1.21.0 #233
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/user-safety"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Step 2 of
docs/website/USER_SAFETY.md(the core): report, block and hide. This is account-deletion step 7, which comes before the Android M8 cutover. The design is the plan of record, plus four decisions the org lead made while this was being built (S11-S14, recorded in the docs PR):ctx.safety.forViewer, and no client module-API member is needed.canBlockfor signed-in readers.Server
POST /player/reportsfiles a report on any target type: the forum's own types or a module's registered ones. One resolver (model/safety/targets.js) answers "what is this item, for this reader". An item the reader cannot see gets the same 404 as one that does not exist.content_reports.snapshot, so the queue still shows what was said after a chat line is pruned or a post is edited.POST /admin/moderation/reports/:id/hideis Hide for everyone. It hides the item through its own moderation (the forum's hide as a staff action, or the module'shide), then actions the report withactioned_with = 'hide'and an audit entry.user_blocksanduser_hidden_itemstables, behind/auth/me/blocksand/auth/me/hidden. A block names an item, never a person. Staff cannot be blocked (403staff). A block on someone who later becomes staff stops applying and says so.canBlockon each thread and post.api.registerReportTargets,api.registerGameIdentities,ctx.safety.forViewerandctx.safety.staffAmong.Web
canBlockis true, and asks for confirmation./accountand/admin/account.Docs: RunicGateway/docs PR on branch
docs/user-safety-core.Not in this PR: team notifications and the team activity feed still include a blocked author's forum posts. The plan doesn't cover them, so I've left them for the org lead to decide.
How it was tested
npm testinserver: 2381 tests, 0 failing. Run with an emptyMODULES_DIR, because the localmodules/rustinstall leaks its routes into the route manifests.npm run buildandnpm testinclient: 446 tests, 0 failing.server/test/userSafety.test.js(S8, S12, S14,forViewer, the registry checks) and new cases incontentReports.test.js,teamForum.test.jsandclient/test/userSafety.test.js.usafety) on the local MariaDB, with a core on:3291and no modules, running the real routes with bearer logins. All 18 rows passed:canBlock: false.Checklist
AI-assisted contributions (required)
Claude Code (Claude Opus 5.5). I have reviewed and understandevery change, and take responsibility for it. AI-authored commits are
marked with a
Co-Authored-By/Assisted-Bytrailer.License
(GNU GPL v3.0 or later), and I have the right to contribute it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY