Commit Graph
404 Commits
Author SHA1 Message Date
MythEclipseandClaude Opus 4.6 37ab92e7ea fix(docker): upgrade all Dockerfiles to node:22-alpine for pnpm v10 compatibility
pnpm v10+ requires the built-in `node:sqlite` module which is only available
in Node 22+. All services now use node:22-alpine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 22:01:35 +07:00
MythEclipseandClaude Opus 4.6 ee540d11f6 fix(ci): lowercase GHCR owner name to fix 'repository name must be lowercase' error
`github.repository_owner` returns 'MythEclipse' (mixed case) which GHCR rejects.
Hardcode lowercase 'mytheclipse' to match GHCR requirements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 21:59:06 +07:00
MythEclipseandClaude Opus 4.6 f20c2389a4 refactor(backend): flatten module structure, move routes to .routes.ts files
- Remove empty controllers/, services/, repositories/ subdirectories
- Move routes/index.ts into module.routes.ts (flat naming convention)
- Update imports in http/app.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 21:53:08 +07:00
MythEclipseandClaude Opus 4.8 c48a0c5e3b refactor: split monolith into 3 microservices (frontend, backend, discord-gateway)
- Extract services into services/{frontend,backend,discord-gateway}
- Create packages/shared/ for shared logger, errors, utils, types
- Setup Modular MVC pattern in backend (controller→service→repository)
- Setup event-driven architecture in discord-gateway with Redis pub/sub
- Move Docker files to infra/docker/ with per-service Dockerfiles
- Update docker-compose.yml to use Traefik-only routing (no port exposes)
- Update GitHub Actions deploy workflow for multi-service matrix build
- Fix all import paths and resolve type errors across all services
- All 3 services pass tsc --noEmit clean

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 21:44:29 +07:00
MythEclipseandClaude Opus 4.8 bda8304bb9 fix(analytics): align flag counts and violation score math
- Count only flagged messages in the active users Flag column
- Coerce PostgreSQL count results to numbers before calculating violation_score
- Prevent string concatenation in flagged*3 + warned scoring

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 19:23:46 +07:00
MythEclipseandClaude Opus 4.8 80f1069e2f fix(moderation): remove unsupported chat_template_kwargs and reasoning_budget
API provider returns 400 error for these params. Removed from all LLM calls
in llmModerationClient.ts and indonesianTextNormalizer.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 19:05:06 +07:00
MythEclipseandClaude Opus 4.8 13efb576d6 fix(moderation): remove manual badword list and fix deferral regex false positives
- Remove LOCAL_BADWORDS array (25 hardcoded words) and FALSE_POSITIVE_WHITELISTS
- Remove detectLocalBadwords function — all detection now goes through API pipeline
- Fix DEFERRAL_ANALYSIS_PATTERN: remove overly broad patterns (admin perlu, bisa berpotensi, maaf/sorry, saya tidak yakin)
- Expand DEFERRAL_EXCEPTION_PATTERN to catch more decisive-deferral variations
- Update tests to reflect API-only detection (local fallback removed)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 19:00:16 +07:00
MythEclipseandClaude Opus 4.8 a643125c7b refactor(moderation): improve LLM moderation client - 10 recommendations
- Add XML delimiters to prevent prompt injection (R1)
- Use JSON Schema response format instead of json_object (R2)
- Add concurrency limiter via p-limit (R3)
- Add timeout per media analysis call (R4)
- Resize images with sharp before vision API (R5)
- Split text batches when exceeding batch size limit (R6)
- Add few-shot examples to system prompt (R7)
- Modularize system prompt builder (R8)
- Enhance deferral detection regex with exception patterns (R9)
- Sanitize error messages to avoid leaking internals (R10)

New files: concurrencyLimiter.ts, imageResizer.ts, moderationPrompt.ts
Updated: llmModerationClient.ts, config.ts, package.json, tests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 18:50:05 +07:00
MythEclipseandClaude Opus 4.8 4117f83c1b fix(dashboard): infinite scroll, auto-refetch, analytics cache invalidation, remove topic row cap
Frontend:
- Cursor pagination (100/page) replacing hardcoded 80 message limit
- Removed .slice(0,200) cap on mergeMessages
- IntersectionObserver infinite scroll with skeleton loading
- 15s periodic refetch for message list sync

Backend:
- Removed LIMIT 2000 from topic trends SQL query
- Added invalidateAnalyticsCache on message capture (messageCreated)
- Added invalidateAnalyticsCache on batch analysis completion

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 18:14:32 +07:00
MythEclipse 5078b34ac2 fix: render custom emoji as images and feed to AI vision pipeline
- Extract custom emoji metadata with Discord CDN URLs
- Download and send emoji images to vision model for moderation analysis
- Render custom emoji as inline images in dashboard instead of raw <:name:id> text
- Add emoji vision cache with deterministic keying by emoji ID
- Add custom emoji vision prompt for context-aware moderation
2026-06-01 17:23:46 +07:00
MythEclipseandClaude Opus 4.8 f5507e01f6 refactor(frontend): major rebuild — feature-sliced architecture + bug fixes + glass-morphism UI
Architecture:
- Feature-sliced directory: entities/, shared/, features/, widgets/
- Consolidated API client (shared/api/client.ts) — all endpoints in one file
- Single WebSocket manager (shared/ws/socket.ts) with typed event bus
- Extracted hooks: useAudioPlayback, useAudioTransmit, useLocalStorage, useUIState
- UI primitives moved to shared/ui/ with barrel export
- Added Skeleton, Toast, MobileTabBar components

Bug fixes (8/8):
1. useMemo→useEffect in RecordingsSubPanel (async side-effect anti-pattern)
2. ArrayBuffer.slice() before WebSocket send (shared buffer bug)
3. Proper useEffect dependency arrays throughout
4. Stable React keys (no index fallbacks)
5. onReanalyze properly awaited (Promise<void> return)
6. monitorGuild memoized with useMemo
7. localStorage validation with shape checking
8. Deleted duplicate socket logic (ws/client.ts removed)

UI polish:
- Glass-morphism design tokens (backdrop-blur, translucent cards)
- Gradient mesh background with subtle radial overlays
- Expandable sidebar + mobile bottom tab bar
- Skeleton loading placeholders
- Audio visualizer with CSS pulse animation

Deleted: src/api/, src/components/, src/hooks/, src/types/, src/ws/, src/lib/
Added: 40 new files across feature-sliced structure

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 16:42:36 +07:00
MythEclipseandClaude Opus 4.8 1aab0d1df1 docs: frontend major refactor design document
Design for feature-sliced architecture, 8 bug fixes, and glass-morphism UI redesign.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 15:51:28 +07:00
MythEclipseandClaude Opus 4.6 23840e33a3 fix: install gnused and coreutils-full for native module scripts
The NixOS base image lacks sed and coreutils in PATH. Native Node.js
post-install scripts (node-pre-gyp, prebuild-install) require sed and
other core utilities. Installing gnused and coreutils-full provides the
necessary binaries for native module compilation.

Also switched back to single nix profile install call (instead of
sequential per-RUN) since all packages now reference the same pinned
nixpkgs commit, eliminating version drift conflicts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:52:26 +07:00
MythEclipseandClaude Opus 4.6 47bfbb278a fix: install coreutils for sed in NixOS container
The node-pre-gyp and prebuild-install wrapper scripts require sed, which
is not in PATH in the NixOS base container. Install coreutils first to
provide sed, dirname, basename, and other core utilities needed by
native module post-install scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:46:23 +07:00
MythEclipseandClaude Opus 4.6 c78a9618f8 fix: add .npmrc shamefully-hoist for native module compilation
pnpm's isolated store prevents native post-install scripts from finding
their dependency binaries (node-pre-gyp, prebuild-install). This causes
@discordjs/opus and @lng2004/node-datachannel to fail during pnpm install.

Enabling shamefully-hoist flattens node_modules so native scripts can
resolve their dependencies correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:42:33 +07:00
MythEclipseandClaude Opus 4.6 86853bbd4e fix: remove explicit cacert install to resolve version conflict
cacert 3.123 was installed first, but nodejs_22 pulls cacert 3.117 as a
transitive dependency, causing a file conflict on ca-bundle.crt.

Since all packages that need SSL certificates already pull cacert as a
dependency, installing it explicitly is redundant and causes conflicts.
Removing the explicit cacert install lets each package use its resolved
transitive cacert version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:38:55 +07:00
MythEclipseandClaude Opus 4.6 20ff930bb3 fix: install nix packages sequentially with pinned nixpkgs commit
Two issues were causing Docker build failures:
1. Invalid nixpkgs commit hash (404 on GitHub archive)
2. Installing packages simultaneously caused version conflicts
   (cacert 3.123 vs 3.117, git vs git-minimal)

Fix:
- Pin to valid nixos-unstable HEAD commit
- Install each package with sequential 'nix profile add' calls
  so each package resolves dependencies before the next installs
- Remove explicit git (git-minimal pulled by yt-dlp is sufficient)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:36:43 +07:00
MythEclipseandClaude Opus 4.6 8883f2bf3a fix: pin nixpkgs to specific commit for reproducible Docker builds
The nixos-unstable channel changes rapidly and causes file conflicts
between packages (cacert 3.123 vs 3.117, git vs git-minimal) because
different packages are resolved from different nixpkgs snapshots during
the same profile install.

Pinning to a specific commit ensures all packages are resolved from the
same nixpkgs snapshot, eliminating version drift and file conflicts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:34:23 +07:00
MythEclipseandClaude Opus 4.6 65d5306764 fix: remove explicit git from nix profile install to resolve packinfo.pl conflict with git-minimal
yt-dlp already pulls git-minimal as a transitive dependency. Adding git
explicitly causes a file conflict on packinfo.pl. Removing git from the
install list resolves this since git-minimal provides all git functionality
needed for CI builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:30:49 +07:00
MythEclipse 4e7be14efe migrate Dockerfile from Debian bookworm to NixOS base
Switch from node:22-bookworm-slim to nixos/nix:latest and install dependencies via Nix profile.
2026-06-01 12:12:37 +07:00
MythEclipse 685b97217d feat(docker): update Traefik router rule to remove redundant host entries 2026-06-01 11:28:54 +07:00
MythEclipse 1ab0fdf884 feat(deploy): update ssh-action version and remove container_name from docker-compose 2026-06-01 11:27:51 +07:00
MythEclipse 8310e58239 feat(config): add API route for app configuration and update related logic for monitor guild 2026-06-01 11:16:07 +07:00
MythEclipse 49e9197ce0 feat(deploy): update deployment workflow and remove obsolete Docker publish workflow 2026-06-01 11:07:25 +07:00
MythEclipse 942b446ff5 feat(deploy): add GitHub Actions workflow for deploying GMW to VPS 2026-06-01 10:56:23 +07:00
MythEclipse a7b3692982 feat(docker): update Docker configuration and add build workflow 2026-06-01 10:53:20 +07:00
MythEclipse c2d5bde633 feat(database): update migration command to use migrateCli and separate migration logic 2026-05-31 23:10:28 +07:00
MythEclipse 7607282db2 feat(database): add automatic migration on startup and enhance text analysis cache source 2026-05-31 23:01:38 +07:00
MythEclipse 96cd0cfc62 refactor(moderation): clean up code formatting for improved readability 2026-05-31 22:05:50 +07:00
MythEclipse 331076a540 feat(moderation): enhance media analysis with separate handling for images and text 2026-05-31 22:01:42 +07:00
MythEclipse 47e7e8e549 feat(moderation): implement media analysis caching with deterministic keys and database integration 2026-05-31 20:57:01 +07:00
MythEclipse d63e34d259 feat(moderation): refactor word analysis caching to text analysis caching with improved context handling 2026-05-31 20:33:27 +07:00
MythEclipse 7e58741b5c feat(moderation): implement per-word analysis caching for improved performance 2026-05-31 20:27:19 +07:00
MythEclipse 34c4e3e017 feat(moderation): add support for vision model in moderation analysis 2026-05-31 20:12:16 +07:00
MythEclipse 47bac6ff8f feat: add Groq Llama Prompt Guard moderation integration
- Updated .env.example to include Groq API configuration.
- Enhanced config schema in config.ts to support Groq API keys and settings.
- Implemented Groq moderation API call in indonesianTextNormalizer.ts as a fallback for badword detection.
- Removed the Indonesian slang normalization function and related tests to streamline moderation logic.
- Updated tests to reflect changes in moderation strategy, focusing on emoji normalization and badword detection.
2026-05-31 19:42:39 +07:00
MythEclipse c30785a978 feat(moderation): add additional channel to skip in message capture logic 2026-05-31 19:04:03 +07:00
MythEclipse f386e6deba chore: remove Dockerfile as part of project restructuring 2026-05-31 18:25:33 +07:00
MythEclipse 4bb90153b0 feat(analytics): add support for selected analytics guild and channel in App component
fix(redis): enhance Redis connection handling with fallback to in-memory storage
chore(sql): create missing messages and attachments tables with necessary constraints and indexes
2026-05-31 17:19:24 +07:00
MythEclipse 30ce607d88 style: format code for improved readability and consistency across multiple files 2026-05-31 16:54:15 +07:00
MythEclipse f224be2a66 Refactor test database setup and add migrations
- Updated test files to use a separate test database configuration.
- Introduced a new helper module for managing test database operations.
- Added a setup file to configure the environment for tests.
- Created new database migration scripts to optimize message indexing.
- Added a sample environment file for test database configuration.
2026-05-31 16:32:38 +07:00
MythEclipse 8a712cff9b Refactor database handling to exclusively support PostgreSQL
- Removed SQLite support from the configuration and database initialization logic.
- Updated database migration scripts to focus solely on PostgreSQL migrations.
- Simplified logging messages to reflect PostgreSQL usage.
- Adjusted database schema definitions to remove SQLite-specific types and structures.
- Modified tests to ensure compatibility with PostgreSQL, including changes to table creation and data types.
- Cleaned up unused imports and code related to SQLite.
2026-05-31 15:46:18 +07:00
MythEclipse d1ef036358 feat(redis): integrate Redis for job queue management and persistent storage 2026-05-31 14:21:43 +07:00
MythEclipse ce945c8af0 fix(analytics): simplify GROUP BY and ORDER BY clauses in getDailyTrend function 2026-05-31 01:34:35 +07:00
MythEclipse 48b4123f58 chore: remove recharts dependency and clean up pnpm-lock.yaml
- Removed "recharts" from package.json and its associated entries from pnpm-lock.yaml.
- Cleaned up unnecessary dependencies and peer dependencies related to recharts and other unused packages.
2026-05-31 01:04:26 +07:00
MythEclipse 39e4e0ddc5 feat(analytics): refactor ActivityChart and TrendChart to use custom rendering and improve data visualization 2026-05-31 01:00:08 +07:00
MythEclipse 38ae6b03dd feat(analytics): add error boundary for AnalyticsPanel and improve loading state handling 2026-05-31 00:52:23 +07:00
MythEclipse 71e240c1e7 feat(analytics): add daily trend and activity heatmap endpoints, and implement corresponding frontend components
- Added new API endpoints for daily trend data and activity heatmap in analyticsRoutes.ts.
- Created new frontend components: ActivityChart, ControlBar, Heatmap, SummaryCards, TopicList, TrendChart, UserTable, and ViolatorTable for displaying analytics data.
- Implemented loading and empty states in the new components.
- Enhanced the existing moderation tests with remote fallback handling for Indonesian text normalization.
2026-05-31 00:41:34 +07:00
MythEclipse 4e9e370eb1 feat: enhance getTopViolators query to use conditional counts for improved accuracy in moderation stats 2026-05-30 21:29:16 +07:00
MythEclipse 10f44138bc feat: implement age restriction handling in message analysis and metadata 2026-05-30 21:12:25 +07:00
MythEclipse c9e79c8c7c feat: refactor database access in analyticsStore to use executeAll and executeGet for improved query handling 2026-05-30 20:40:33 +07:00