Skip to content

refactor(dry): WatcherEventBuilder — eliminate 450 LOC boilerplate#232

Merged
slabgorb merged 1 commit intodevelopfrom
feat/dry-watcher-event-builder
Apr 1, 2026
Merged

refactor(dry): WatcherEventBuilder — eliminate 450 LOC boilerplate#232
slabgorb merged 1 commit intodevelopfrom
feat/dry-watcher-event-builder

Conversation

@slabgorb
Copy link
Copy Markdown
Owner

@slabgorb slabgorb commented Apr 1, 2026

Summary

  • New WatcherEventBuilder with .field(), .field_opt(), .severity(), .send()
  • 45 callsites converted across 12 files
  • Net -450 LOC (900 deleted, 450 added including builder definition)

DRY audit item #1 of 5

WatcherEvent HashMap construction was the highest-ROI DRY fix identified in the wiring audit.

Test plan

  • cargo build -p sidequest-server passes
  • OTEL dashboard still receives watcher events
  • All telemetry fields preserved (same JSON output)

🤖 Generated with Claude Code

…lerplate

45 hand-built HashMap callsites converted to WatcherEventBuilder pattern.
Net -450 LOC. Builder provides .field(), .field_opt(), .severity(), .send().

12 files changed across dispatch/, main.rs, and lib.rs.
Removed unused HashMap, chrono::Utc, and Severity imports where applicable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@slabgorb slabgorb merged commit 743866c into develop Apr 1, 2026
@slabgorb slabgorb deleted the feat/dry-watcher-event-builder branch April 5, 2026 12:55
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