regressing rn

This commit is contained in:
legop3
2026-04-29 18:31:02 -04:00
parent fed0cab0b8
commit 01a8d044e7
61 changed files with 139 additions and 17 deletions
+2
View File
@@ -1,3 +1,5 @@
// Global Config
// Purpose: Stores process-level mutable configuration shared across services. Scope: Provides read/write access to runtime config loaded at server startup.
const path = require('path');
module.exports = {
+2
View File
@@ -1,3 +1,5 @@
// Global HTTP Server
// Purpose: Stores the process-level HTTP server instance created at bootstrap. Scope: Enables services to access server lifecycle state without circular imports.
const http = require('http');
const express = require('express');
const morgan = require('morgan');
+2
View File
@@ -1,3 +1,5 @@
// Global Socket.IO
// Purpose: Stores the singleton Socket.IO server instance for cross-service access. Scope: Exposes getters/setters used during startup wiring and runtime event emission.
const { Server: SocketIOServer } = require('socket.io');
const { httpServer } = require('./http');
+2
View File
@@ -1,3 +1,5 @@
// Global Logger
// Purpose: Configures structured console logging helpers used by server services. Scope: Formats timestamped log lines and supports child logger prefixes.
const sinks = new Set();
function notifySinks(level, label, args) {
+2
View File
@@ -1,3 +1,5 @@
// Global WebSocket Server
// Purpose: Stores the shared raw WebSocket server instance for modules that need direct access. Scope: Centralizes setter/getter access for process-wide WS wiring.
const { WebSocketServer } = require('ws');
const { httpServer } = require('./http');
const logger = require('./logger');
+2
View File
@@ -1,3 +1,5 @@
// Config Loader Helper
// Purpose: Loads and validates YAML server configuration from configured paths. Scope: Provides normalized config access with sane defaults and cache behavior.
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
+2
View File
@@ -1,3 +1,5 @@
// IP Resolver Helper
// Purpose: Resolves client IP addresses from request/socket metadata and proxy headers. Scope: Normalizes IP extraction so auth/logging services use consistent address values.
const net = require('net');
function extractForwardedIp(value) {
+2
View File
@@ -1,3 +1,5 @@
// Sensor Decoder Helper
// Purpose: Decodes incoming rover sensor payloads into normalized telemetry fields. Scope: Handles binary/string parsing and defensive fallback behavior for malformed frames.
const HEADER = 0x13;
const CHARGING_STATE = {
0: 'not charging',
@@ -1,3 +1,5 @@
// Reward Definition: Assignment Roulette
// Purpose: Defines the assignment-roulette reward for reshuffling control assignments. Scope: Encodes reward identity, messaging, and runtime action parameters.
module.exports = {
id: 'assignmentRoulette',
name: 'Rover Reassignment',
@@ -1,3 +1,5 @@
// Reward Definition: Camera Whiplash
// Purpose: Defines the camera-whiplash deterrence reward and timing/strength settings. Scope: Supplies reusable reward metadata and execution parameters for chaos triggers.
const STEP_MS = 220;
const DURATION_MS = 30 * 1000;
const STEPS = Math.ceil(DURATION_MS / STEP_MS);
@@ -1,3 +1,5 @@
// Reward Definition: Chat Spam
// Purpose: Defines the chat-spam reward for automated disruptive message bursts. Scope: Exposes metadata and effect settings consumed by reward execution.
const LETTERS = 'abcdefghijklmnopqrstuvwxyz';
const BURST_COUNT = 18;
const MIN_BURST_SIZE = 2;
@@ -1,3 +1,5 @@
// Reward Definition: Darkness
// Purpose: Defines the darkness reward that alters visibility/lighting behavior. Scope: Encapsulates reward metadata and effect configuration for runtime execution.
const DURATION_MS = 15 * 60 * 1000;
const LIGHT_ENFORCE_TICK_MS = 3000;
// Rover daemon semantics are inverted:
@@ -1,3 +1,5 @@
// Reward Definition: Discord Stalker Ping
// Purpose: Defines the Discord ping reward that notifies configured channels/users. Scope: Provides reward metadata and dispatch parameters for integration handlers.
module.exports = {
id: 'discordStalkerPing',
name: 'Discord Ping',
@@ -1,3 +1,5 @@
// Reward Definition: Dock Panic
// Purpose: Defines the dock-panic deterrence reward behavior and metadata. Scope: Produces a deterministic action payload used by reward execution pipelines.
const DOCK_COMMAND_BASE64 = Buffer.from([143]).toString('base64');
module.exports = {
@@ -1,3 +1,5 @@
// Reward Definition: Ghost Typing Spam
// Purpose: Defines the ghost-typing spam reward used for chat-based deterrence events. Scope: Exposes reward metadata and handler inputs for moderation/reward pipelines.
const NAMES = ['ross', 'david', 'chirpet', 'caydu', 'meow', 'wawa'];
const BURSTS = 120;
const MIN_BURST_DELAY_MS = 70;
@@ -1,3 +1,5 @@
// Reward Definition: Light Strobe
// Purpose: Defines the light-strobe deterrence reward and activation contract. Scope: Encapsulates reward identity, labels, and effect parameters for runtime dispatch.
const STROBE_MS = 30 * 1000;
const TICK_MS = 70;
@@ -1,3 +1,5 @@
// Reward Definition: Mode Jam
// Purpose: Defines the mode-jam reward that interferes with mode/state transitions. Scope: Supplies effect metadata and execution inputs to reward orchestration code.
const MIN_DURATION_MS = 5 * 60 * 1000;
const MAX_DURATION_MS = 10 * 60 * 1000;
+2
View File
@@ -1,3 +1,5 @@
// Reward Registry
// Purpose: Registers and exports all deterrence/chaos reward definitions. Scope: Builds the canonical reward catalog consumed by button box and moderation flows.
const dockPanic = require('./definitions/dockPanic');
const cameraWhiplash = require('./definitions/cameraWhiplash');
const lightStrobe = require('./definitions/lightStrobe');