Add the trust and safety subsystem and the App Store compliance work
Implements the moderation and consent obligations a social platform carries, so the web version and any client that speaks to it enforce the same rules. Moderation core (services/moderation/, database/moderation.py): a reportable target registry, the content filter and its choke points, the report queue with atomic resolution, enforcement actions, consent tracking, maturity gating, and account deletion with a grace window. Surfaces: POST /reports plus the member report list, /admin/moderation and the per-report admin view, /workspaces, terms acceptance at /auth/terms, consent and account deletion under /profile, the report button and dialog partials, the maturity gate, and the moderation stylesheet and ReportDialog client. Every user-generated surface stays reportable by construction: new content tables are registered in REPORTABLE_TARGETS or listed in UNREPORTABLE_TABLES with a reason, and the registry test fails the suite on anything left unclassified. Docs: community guidelines, content moderation, intellectual property, privacy, terms, contact, and the admin-only moderation operations page, plus the moderation API group and the Devii moderation actions. Compliance record: applecomp.md is the requirement register, applechanges.md the gap analysis against this codebase, and appleimpl.md the implementation design they resolve to. Tests cover the report flow, admin moderation, consent, account deletion, terms acceptance, workspaces, and the registry invariant across the unit, api, and e2e tiers.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
retoor <retoor@molodetz.nl>
|
||||
|
||||
Every state-changing action in DevPlace records one append-only row through `devplacepy/services/audit/record.py` (`record` for a request-scoped actor, `record_system` for a background one). This file is the authoritative catalogue of the 288 event keys currently emitted, grouped by the category `services/audit/categories.py` `category_for` resolves them to.
|
||||
Every state-changing action in DevPlace records one append-only row through `devplacepy/services/audit/record.py` (`record` for a request-scoped actor, `record_system` for a background one). This file is the authoritative catalogue of the 331 event keys currently emitted, grouped by the category `services/audit/categories.py` `category_for` resolves them to.
|
||||
|
||||
## Rules
|
||||
|
||||
@@ -18,14 +18,14 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
|
||||
| Category | Keys |
|
||||
|---|---|
|
||||
| `account` | 10 |
|
||||
| `account` | 16 |
|
||||
| `admin` | 21 |
|
||||
| `ai` | 10 |
|
||||
| `ai` | 11 |
|
||||
| `attachment` | 5 |
|
||||
| `auth` | 9 |
|
||||
| `auth` | 8 |
|
||||
| `backup` | 2 |
|
||||
| `cli` | 42 |
|
||||
| `container` | 12 |
|
||||
| `cli` | 43 |
|
||||
| `container` | 36 |
|
||||
| `content` | 37 |
|
||||
| `database` | 4 |
|
||||
| `devii` | 18 |
|
||||
@@ -34,6 +34,7 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
| `game` | 6 |
|
||||
| `ingress` | 1 |
|
||||
| `message` | 2 |
|
||||
| `moderation` | 12 |
|
||||
| `news` | 9 |
|
||||
| `notification` | 4 |
|
||||
| `project` | 11 |
|
||||
@@ -47,7 +48,7 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
| `telegram` | 5 |
|
||||
| `tools` | 12 |
|
||||
|
||||
**Total: 288 keys.**
|
||||
**Total: 331 keys.**
|
||||
|
||||
## Account and profile (`account`)
|
||||
|
||||
@@ -63,6 +64,12 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
| `profile.notification.reset` | `routers/profile/notifications.py` |
|
||||
| `profile.notification.toggle` | `routers/profile/notifications.py` |
|
||||
| `profile.update` | `routers/devrant/auth.py`, `routers/profile/index.py` |
|
||||
| `account.delete.purge` | `services/moderation/deletion.py` |
|
||||
| `account.delete.request` | `routers/devrant/auth.py`, `routers/profile/delete.py` |
|
||||
| `consent.grant` | `routers/profile/consent.py` |
|
||||
| `profile.mature_content` | `routers/profile/consent.py` |
|
||||
| `consent.withdraw` | `routers/profile/consent.py` |
|
||||
| `terms.accept` | `routers/auth/terms.py` |
|
||||
|
||||
## Administration (`admin`)
|
||||
|
||||
@@ -94,6 +101,7 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
|
||||
| Event key | Recorded in |
|
||||
|---|---|
|
||||
| `ai.consent.denied` | `services/openai_gateway/service.py` |
|
||||
| `ai.clippy.chat` | `routers/devii.py` |
|
||||
| `ai.gateway.call` | `services/openai_gateway/gateway.py`, `services/openai_gateway/usage.py` |
|
||||
| `ai.quota.exceeded` | `routers/devii.py`, `services/openai_gateway/service.py` |
|
||||
@@ -119,7 +127,6 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
|
||||
| Event key | Recorded in |
|
||||
|---|---|
|
||||
| `auth.account.disable` | `routers/devrant/auth.py` |
|
||||
| `auth.login.failure` | `routers/auth/login.py`, `routers/devrant/auth.py` |
|
||||
| `auth.login.success` | `routers/auth/login.py`, `routers/devrant/auth.py` |
|
||||
| `auth.logout` | `routers/auth/logout.py` |
|
||||
@@ -140,6 +147,7 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
|
||||
| Event key | Recorded in |
|
||||
|---|---|
|
||||
| `cli.accounts.prune` | `cli/accounts.py` |
|
||||
| `cli.apikey.backfill` | `cli/apikeys.py` |
|
||||
| `cli.apikey.reset` | `cli/apikeys.py` |
|
||||
| `cli.attachments.prune` | `cli/attachments.py` |
|
||||
@@ -361,6 +369,23 @@ Every state-changing action in DevPlace records one append-only row through `dev
|
||||
| `message.read_on_view` | `routers/messages.py` |
|
||||
| `message.send` | `services/messaging/persist.py` |
|
||||
|
||||
## Moderation (`moderation`)
|
||||
|
||||
| Event key | Recorded in |
|
||||
|---|---|
|
||||
| `filter.block` | `services/moderation/screening.py` |
|
||||
| `filter.maturity` | `services/moderation/screening.py` |
|
||||
| `filter.review` | `services/moderation/screening.py` |
|
||||
| `moderation.ban` | `routers/admin/moderation.py`, `routers/admin/users.py` |
|
||||
| `moderation.lift` | `routers/admin/moderation.py`, `routers/admin/users.py` |
|
||||
| `moderation.remove` | `routers/admin/moderation.py` |
|
||||
| `moderation.restore` | `routers/admin/moderation.py` |
|
||||
| `moderation.suspend` | `routers/admin/moderation.py`, `routers/admin/users.py` |
|
||||
| `moderation.warn` | `routers/admin/moderation.py` |
|
||||
| `report.create` | `routers/reports.py` |
|
||||
| `report.decide` | `routers/admin/moderation.py` |
|
||||
| `report.status` | `routers/admin/moderation.py` |
|
||||
|
||||
## News (`news`)
|
||||
|
||||
| Event key | Recorded in |
|
||||
@@ -447,7 +472,7 @@ Both carry `metadata.provider` (`webpush`, `apns`, ...) plus `created`; `metadat
|
||||
|
||||
| Event key | Recorded in |
|
||||
|---|---|
|
||||
| `security.authz.denied` | `routers/admin/backups.py`, `services/devii/actions/dispatcher.py` |
|
||||
| `security.authz.denied` | `routers/admin/backups.py`, `routers/profile/delete.py`, `services/devii/actions/dispatcher.py`, `utils/guards.py` |
|
||||
| `security.maintenance.block` | `main.py` |
|
||||
| `security.rate_limit.block` | `main.py` |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user