docs(website): record the PR 2 admin router split (moderation, bot-activity, activity) #54

Merged
whitlocktech merged 1 commits from docs/admin-router-split-2 into main 2026-07-28 00:11:17 +00:00
Member

What & why

Documentation for website#103 — PR 2 of the admin router domain split (moderation 15, bot-activity 2, activity 1; 18 routes, leaving 64 in the residual admin.routes.js).

API_V2_PLAN.md:

  • New "PR 2 — as landed" section: the router/route/prefix/gate table and the four zero-diff gates.
  • Records two decisions that constrain PRs 3–5:
    • /activity gets its own file, deviating from the target tree, which parked it as a singleton inside dashboard.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 mounts dashboard + site-mode only; the target tree and the sequencing list are 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.
  • Status line: split PRs 1–2 of 5 landed.

BACKEND_DESIGN.md: §2 folder structure gains the three new router files with their gates and updated route counts (residual 82 → 64); §4's /admin contract preamble now names bot-activity as adminOnly and moderation as modAccess.

PROJECT_TREE.md is deliberately untouched — since website#98 it is auto-generated by the sync-project-tree workflow.

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

  • I have read CONTRIBUTING.md.
  • The change builds and existing tests/checks pass locally.
  • I have added or updated tests/docs where it makes sense.
  • My commits are reasonably scoped with clear messages.

AI-assisted contributions (required)

  • No AI tools were used to produce this contribution.
  • AI tools were used. Tool(s): Claude Code. I have reviewed and understand
    every change, and take responsibility for it. AI-authored commits are
    marked with a Co-Authored-By / Assisted-By trailer.

License

  • I agree that my contribution is licensed under this project's license
    (GNU GPL v3.0 or later), and I have the right to contribute it.
## What & why Documentation for **website#103** — PR 2 of the admin router domain split (`moderation` 15, `bot-activity` 2, `activity` 1; 18 routes, leaving 64 in the residual `admin.routes.js`). `API_V2_PLAN.md`: - New **"PR 2 — as landed"** section: the router/route/prefix/gate table and the four zero-diff gates. - Records two decisions that constrain PRs 3–5: - **`/activity` gets its own file**, deviating from the target tree, which parked it as a singleton inside `dashboard.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 mounts `dashboard` + `site-mode` only**; the target tree and the sequencing list are 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. - Status line: split PRs 1–2 of 5 landed. `BACKEND_DESIGN.md`: §2 folder structure gains the three new router files with their gates and updated route counts (residual 82 → 64); §4's `/admin` contract preamble now names `bot-activity` as `adminOnly` and `moderation` as `modAccess`. `PROJECT_TREE.md` is deliberately untouched — since website#98 it is auto-generated by the `sync-project-tree` workflow. ## 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 - [x] I have read [CONTRIBUTING.md](CONTRIBUTING.md). - [x] The change builds and existing tests/checks pass locally. - [x] I have added or updated tests/docs where it makes sense. - [x] My commits are reasonably scoped with clear messages. ## AI-assisted contributions (required) - [ ] No AI tools were used to produce this contribution. - [x] AI tools were used. Tool(s): `Claude Code`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` / `Assisted-By` trailer. ## License - [x] I agree that my contribution is licensed under this project's license (**GNU GPL v3.0 or later**), and I have the right to contribute it.
wtclaude added 1 commit 2026-07-27 23:55:32 +00:00
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>
whitlocktech approved these changes 2026-07-28 00:11:08 +00:00
whitlocktech merged commit d034c6f673 into main 2026-07-28 00:11:17 +00:00
whitlocktech deleted branch docs/admin-router-split-2 2026-07-28 00:11:17 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/docs#54
No description provided.