docs(website): record the PR 2 admin router split (moderation, bot-activity, activity) #54
Reference in New Issue
Block a user
No description provided.
Delete Branch "docs/admin-router-split-2"
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
Documentation for website#103 — PR 2 of the admin router domain split (
moderation15,bot-activity2,activity1; 18 routes, leaving 64 in the residualadmin.routes.js).API_V2_PLAN.md:/activitygets its own file, deviating from the target tree, which parked it as a singleton insidedashboard.router.js(PR 4). Honouring the tree would have meant leaving one route in the residual file for two more PRs to satisfy a filename, and it is a genuinely separate capability — the staff audit log, not the dashboard's stats overview and not the botScore middleware's ban state. PR 4 now mountsdashboard+site-modeonly; the target tree and the sequencing list are updated to match.useonly where it was already a prefix mount (moderation'smodAccess). Bot-activity's per-routeadminOnlystays per-route, because the per-route handler count is the only thing inroutes.guards.jsonthat would catch a dropped gate —requireRole(...)returns an anonymous arrow and never appears by name.BACKEND_DESIGN.md: §2 folder structure gains the three new router files with their gates and updated route counts (residual 82 → 64); §4's/admincontract preamble now namesbot-activityasadminOnlyandmoderationasmodAccess.PROJECT_TREE.mdis deliberately untouched — since website#98 it is auto-generated by thesync-project-treeworkflow.How it was tested
Docs-only. Every claim is taken from the verified state of website#103: manifest / guards / swagger / inventory all zero-diff, 434 server tests green, and role gates dumped from the live Express stack and diffed against
main(identical).Checklist
AI-assisted contributions (required)
Claude Code. 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.
Matches the code change in website: 18 more admin routes carved into moderation.router.js (15), botActivity.router.js (2) and activity.router.js (1), leaving 64 in the residual admin.routes.js. API_V2_PLAN.md gains a "PR 2 — as landed" section recording the four zero-diff gates and two decisions worth carrying into PRs 3-5: - /activity gets its own file rather than the target tree's plan to park it as a singleton inside dashboard.router.js — honouring the tree would have left one route in the residual file for two PRs, and it is a genuinely separate capability (the staff audit log, not the dashboard's stats overview and not the botScore middleware's ban state). PR 4 therefore mounts dashboard and site-mode only; the target tree is updated to match. - A gate moves to a router-level `use` only where it was already a *prefix* mount (moderation's modAccess). Bot-activity's per-route adminOnly stays per-route, because the per-route handler count is the only thing in routes.guards.json that would catch a dropped gate — requireRole(...) returns an anonymous arrow and never appears by name. BACKEND_DESIGN.md §2 (folder structure) and §4 (the /admin contract preamble) are updated for the new files and their gates. PROJECT_TREE.md is left alone — since website#98 it is auto-generated by the sync-project-tree workflow. Co-Authored-By: Claude <noreply@anthropic.com>