Skip to content

Huge amounts more Effect in the codebase#265

Merged
vcarl merged 14 commits intomainfrom
vc-effectify-moar
Jan 30, 2026
Merged

Huge amounts more Effect in the codebase#265
vcarl merged 14 commits intomainfrom
vc-effectify-moar

Conversation

@vcarl
Copy link
Member

@vcarl vcarl commented Jan 28, 2026

  • Significantly improve Automod logging behavior
  • Update formatting for Track and other logs to be more consistent with each other
  • Move a ton of inline Effect.tryPromise calls to use a "discord sdk" helper file
  • Convert all Discord command logic to be Effect-based
  • Simplify logic surrounding Interaction handling and routing
  • Revise internal Effect docs to help AIs work better
  • Suppress "debug"-level logs in production

vcarl and others added 4 commits January 28, 2026 18:16
- Create app/effects/discordSdk.ts with Effect-wrapped Discord.js helpers:
  fetchGuild, fetchChannel, fetchMember, fetchMessage, sendMessage, etc.
- Add fetchSettingsEffect to guilds.server.ts for Effect-based settings fetch
- Update escalate, report, and resolver code to use new SDK helpers
- Consolidate error types in effects/errors.ts (rename discordError -> cause)
- Fix missing Layer imports and service layer provision in handlers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Phase 1: demo.ts, force-ban.ts, report.ts
- Phase 2: setup.ts, setupReactjiChannel.ts, setupHoneypot.ts, setupTickets.ts
- Phase 3: escalationControls.ts, escalate/handlers.ts (8 handlers)

Replaced async/await with Effect.gen, trackPerformance with Effect.withSpan,
log() with logEffect(), and try/catch with Effect.catchAll patterns.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
vcarl and others added 3 commits January 29, 2026 11:55
EFFECT.md rewritten as a "reading and writing Effect code" guide with
real codebase examples and file references. EFFECT_REFERENCE.md trimmed
to only patterns we use, with outdated syntax fixed. Unused patterns
(Streams, Schedules, etc.) moved to new EFFECT_ADVANCED.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vcarl vcarl requested a review from Copilot January 29, 2026 19:41
@vcarl vcarl marked this pull request as ready for review January 29, 2026 19:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR represents a massive conversion effort to adopt Effect-TS patterns throughout the codebase, including comprehensive documentation updates, new SDK wrappers, and conversion of all command handlers to Effect-based implementations.

Changes:

  • Created comprehensive Effect documentation suite (EFFECT.md, EFFECT_REFERENCE.md, EFFECT_ADVANCED.md) with practical patterns and examples
  • Implemented Discord SDK Effect wrappers (discordSdk.ts) for consistent error handling across Discord.js operations
  • Converted all command handlers (setup, report, force-ban, track, escalation system, tickets, etc.) from async/await to Effect-based implementations
  • Standardized error types by renaming fields (discordError/stripeErrorcause) and consolidating error classes
  • Refactored database operations to use Effect patterns with new fetchSettingsEffect and other Effect-returning functions

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
notes/EFFECT*.md Complete documentation overhaul - reference guide, onboarding, and advanced patterns
app/effects/discordSdk.ts New file with Effect wrappers for all Discord API operations
app/effects/errors.ts Consolidated error types, renamed fields for consistency
app/commands/escalate/handlers.ts Converted 8 handlers to pure Effect with improved error handling
app/commands/*.ts Converted all slash commands and context menus to Effect-based handlers
app/models/*.ts Added Effect-returning database operations alongside legacy versions
app/commands/report/*.ts Refactored logging and reporting system to use Effect patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

Preview environment removed

The preview for this PR has been cleaned up.

@vcarl vcarl force-pushed the vc-effectify-moar branch from 87e9c1d to 211ae79 Compare January 30, 2026 06:04
@vcarl vcarl merged commit 94cd0bc into main Jan 30, 2026
5 checks passed
@vcarl vcarl deleted the vc-effectify-moar branch January 30, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant