Skip to content

Command handler registry: migrate projector to handler pattern #137

Description

@harrryyd

What to build

Apply the same handler registry pattern from #136 to projectEvent in apps/server/src/orchestration/projector.ts. Instead of a switch over event type, use a ProjectionHandlerRegistry where each event type registers its projection handler.

Each h-code event type (thread.archived-and-new-created, thread.trim-point-created) moves to its own file alongside its corresponding command handler (established in #136). Upstream event types migrate to their own handler files too.

Acceptance criteria

  • ProjectionHandlerRegistry created (reusing MethodRegistry pattern from Pre-factor: MethodRegistry generic utility #132)
  • projectEvent dispatches through registry instead of switch
  • h-code event projections moved to dedicated files alongside command handlers
  • All existing projector behavior preserved (tests pass)
  • vp check and vp run typecheck pass

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions