tex
text · 16 views · 4 unique · 2026-03-15 05:39:53 · raw
Staying in Plan Mode, here’s the checkpoint summary I’d preserve:
This repo is already a full HoboStreamer platform, not just a website shell. It has auth, chat, streams, VOD/clips, monetization, staff roles, and an existing multiplayer HoboGame.
The existing game is substantial: server/game/* plus public/js/game.js already provide movement, WebSocket multiplayer, building, gathering, combat, inventory, quests, and leaderboards.
We chose the new feature direction:
canvas mode: separate board page
who paints: logged-in users only
board reset model: persistent
Recommended implementation path:
first fix current auth/staff bugs
then add a separate collaborative canvas under the Game area
keep the current adventure game accessible as a subview
Bugs/issues already identified:
login/register responses set currentUser = data.user, but frontend expects currentUser.capabilities; only /api/auth/me currently provides capabilities
/admin UI is role-aware in the frontend, but /api/admin/* is admin-only, so global-mod flows are mismatched
/api/mod/chat/search and /api/mod/chat/user/:userId need tighter permission checks
channel-mod backend exists, but there is effectively no matching management UI
Architecture direction for the canvas:
keep Game in the top nav
make /game the new canvas view
move current HoboGame to something like /game/adventure
add a dedicated canvas API + WebSocket path rather than forcing it into the survival-map runtime
Moderation direction:
admin = full site/canvas controls
global mods = site-wide moderation and canvas moderation, but not full admin settings/user management
channel mods / stream mods = channel-scoped only, separate from the global canvas powers
Anti-abuse direction:
account-only painting
server-side cooldown tiers tied to existing game/account progression
overwrite cooldown per tile
audit log, rollback tools, region locks, board freeze, snapshots, canvas bans
If you want the file version, switch out of Plan Mode and I’ll write a real memory file in the workspace and read it back.
Plan
HoboStreamer Staff Fixes + Collaborative Canvas
Summary
The codebase is already a full Node/Express + SQLite streaming platform with chat, VOD/clips, monetization, admin/mod roles, and an existing multiplayer HoboGame. We should extend it, not replace it.
Ship this in two layers: first fix the current auth/moderation bugs, then add a separate persistent r/place-style canvas under the existing Game area.
Easy bugs to fix up front: auth responses/frontend lose capabilities, the current global-mod admin flow calls admin-only endpoints, /api/mod/chat/* is too open, and channel-mod features exist on the backend but have no real UI.
Key Changes
Staff/Auth Foundation
Make POST /api/auth/login, POST /api/auth/register, and GET /api/auth/me all return user plus capabilities, and update the frontend to preserve those capabilities after login and refresh.
Rework /admin into a role-aware staff console:
admin: full tabs and all /api/admin/* actions.
global_mod: moderation-only tabs backed by /api/mod/*, not admin-only endpoints.
channel owner / channel_mod: channel-scoped tools in the channel/dashboard UI, not site-wide staff tabs.
Lock down /api/mod/chat/search and /api/mod/chat/user/:userId so regular users cannot access them.
Add missing channel-mod UI for existing backend routes:
manage channel moderators
edit channel moderation settings
view channel-scoped logs/mod actions where permitted
Fix current UI scope mistakes:
global mods should not see admin-only tabs like user management/settings/global-mod promotion
the current “Global Mods” tab becomes admin-only
Collaborative Canvas
Keep the existing top-nav Game item and turn it into a game hub:
/game = new Canvas view
/game/adventure = existing HoboGame
Build the canvas as a separate board page/service, not inside the adventure map.
Board spec:
one persistent global board
size 512 x 512
fixed 32-color palette
click-to-paint primary interaction
arrow-key cursor movement + place shortcut as accessibility fallback
zoom, pan, coordinate readout, hover metadata, recent activity feed
Paint permissions:
logged-in accounts only
anonymous users can view, but not place tiles
Anti-abuse rules:
per-user placement interval based on total game level from the existing game profile:
level 0-24: 10s
level 25-74: 8s
level 75-149: 7s
level 150-299: 6s
level 300+: 5s
account age under 24h: clamped to 12s
each tile gets a 20s overwrite cooldown after a change
server-side IP/account rate checks feed a moderation audit trail
Canvas Moderation
Add board-specific persistence for:
current tile state
append-only action log
board settings
snapshots
region locks/protected zones
canvas-specific user/IP bans
Admin controls:
read-only/freeze board
full wipe
snapshot export/restore
change palette, cooldowns, and rate tiers
permanent canvas bans
lock/unlock/protect regions
per-user quota overrides
Global mod controls:
rollback single tile
rollback by user
rollback by rectangle
rollback by time range
temporary canvas bans/mutes
inspect action history and user/IP heatmaps
temporary region locks
Channel/stream mods stay channel-scoped and do not get site-wide canvas powers by default, because this board is global.
Public API / Interface Changes
Auth responses always include capabilities.
New canvas HTTP surface under /api/game/canvas/*:
snapshot/current board
placement
recent history
staff rollback/ban/lock actions
admin settings/snapshot restore
New realtime socket endpoint /ws/canvas with messages for:
initial board load
tile patch updates
cooldown/rate state
moderation notices
board freeze/read-only state
Frontend routing changes:
Game page becomes a hub with Canvas and Adventure subviews
existing survival game remains accessible
Test Plan
Auth and UI:
admin/global_mod keep correct capabilities after login and full page refresh
admin/global_mod/channel-mod each see only their allowed controls
Security:
regular users cannot hit /api/mod/chat/*
channel mods only access channel-scoped moderation data
anonymous users cannot place canvas tiles
Canvas behavior:
live multi-user paint sync
cooldown tiers match total game level
tile overwrite cooldown works
board persists across restart
rollback by user/region/time works
freeze/read-only and snapshot restore work
Integration:
/game opens Canvas
/game/adventure still loads current HoboGame
existing site nav/admin/dashboard behavior stays intact
Assumptions
Use the existing top-level Game nav item instead of adding a second top-level tab.
The canvas is a site-global, persistent board until staff manually reset or restore it.
Logged-in-only painting is the correct anti-abuse baseline.
Channel/stream moderation gets cleaned up and surfaced properly, but it remains separate from site-wide canvas moderation.
Implement plan
32 previous messages
Implemented the plan across the existing app rather than replacing it.
Staff/auth + moderation UI is now split properly. staff-console.js overrides the old admin-only frontend so admin gets full site controls, global_mod gets moderation/canvas tools backed by /api/mod/*, and admin-only tabs stay hidden from non-admin staff. I also added the missing admin canvas settings read route in canvas-routes.js.
Channel-owner / channel-mod tools now exist in the dashboard via dashboard-moderation.js. That surfaces channel moderator management, channel chat settings, channel-scoped moderation logs, and channel chat search/delete against the new /api/channels/* routes.
The collaborative canvas is integrated as the primary /game experience while the original HoboGame stays on /game/adventure, with styling completed in game.css. Shared styling for the new staff and dashboard moderation panels is in style.css.
Chat moderation UI now respects capabilities in chat.js: site-wide chat logs and ban actions are staff-only, they use /api/mod/*, and mod/global-mod badges render correctly.
I also wrote the checkpoint file you asked for at codex-memory.md.