Add enforcement journal query RPC with guild-scoped privacy filters #153
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.
Implements API to query enforcement journals with automatic privacy filtering based on guild membership and privilege levels. Addresses requirement to expose enforcement records while protecting moderator PII across guild boundaries.
Implementation
enforcement/journal/queryacceptsuser_idand optionalgroup_ids[]enforcer_user_id,enforcer_discord_id, andnotesfields unless requester has auditor role in that specific guildAPI
Request:
{ "user_id": "target-player-id", "group_ids": ["guild-a", "guild-b"] // optional filter }Response (auditor view):
{ "user_id": "target-player-id", "entries": [{ "id": "record-id", "group_id": "guild-a", "enforcer_user_id": "mod-id", // only if auditor "enforcer_discord_id": "discord-id", // only if auditor "notes": "internal moderator notes", // only if auditor "suspension_notice": "user-facing text", "suspension_expiry": "2024-01-20T00:00:00Z", "is_voided": false }] }Privacy Model
voided_by_user_id,void_notes): same privilege rules applyFiles
evr_runtime_rpc_enforcement.go- RPC implementation with privacy filteringevr_runtime_rpc_enforcement_test.go- 11 test cases covering guild/privilege scenariosENFORCEMENT_JOURNAL_QUERY_API.md- API documentation with 6 usage examplesENFORCEMENT_JOURNAL_QUERY_SECURITY.md- Security analysis and approvalOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.