Skip to content

refactor(core,db,cli,desktop): hoist duplicated CompositeEventBus + DbEventHandler + LogEventHandler #69

Closed

Description

@utof

Per docs/research/architecture_audit.md §3.2.

Problem

CompositeEventBus, DbEventHandler, and LogEventHandler are defined verbatim in both crates/cli/src/cmd/watch.rs and crates/desktop/src/commands.rs. Literal copy-paste duplication (verified via codebase-memory-mcp search during the 2026-04-20 hardening session).

Fix

  • Move EventBus trait + composite impl into crates/core (events are domain concepts).
  • Move DbEventHandler into crates/db.
  • Move LogEventHandler into a small telemetry module (or inline in crates/app as a static helper).
  • Registration happens once in AppContainer::new (see refactor(app): extract crates/app UseCase layer (Phase 6 prep) #66 for crates/app extract).

Dependency

Blocks on #66 (crates/app extract). Before the app crate exists, there's no single place to register handlers without re-duplicating at each shell entry point.

Scope estimate

~50-100 LOC net deletion. Mechanical once the app crate is in place.

Source

docs/research/architecture_audit.md §3.2.

Activity

  1. added
    type/chore
    on Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions