You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backbeat's event-driven architecture is over-applied. A full audit of the codebase identified that 18 of the 42 events are pure overhead — query events that add latency, linear chains pretending to be event-driven, informational events consumed only for debug logging, and dead code (defined but never emitted or subscribed). The architecture works, but it's more complex than necessary.
Separately, a critical concurrency gap exists: every beat run and beat mcp start calls bootstrap(), creating an independent in-memory runtime (queue, worker pool, event bus). Multiple CLI invocations share SQLite but have zero awareness of each other's workers, causing uncoordinated spawning and inaccurate resource monitoring.
Additionally, task output is captured in-memory only (OutputCapture uses Map<TaskId, OutputBuffer>). Cross-process output visibility is impossible — beat task logs from a different process returns nothing. An OutputRepository with SQLite backing (task_output table) exists but is never wired into the live capture path.
Decisions
Hybrid event model — Keep events for terminal-state fan-out (where multiple independent handlers react). Replace query events, linear trigger chains, and informational events with direct calls.
SQLite coordination over daemon — Add a workers table for cross-process worker tracking instead of running a daemon. Backbeat's orchestration is infrequent (spawns every 10s+); a daemon is overkill.
Output persistence — Wire the existing OutputRepository into ProcessConnector so output is persisted to SQLite during capture. Enables cross-process beat task logs and the lightweight CLI path.
Lightweight CLI path — Read-only CLI commands (task status, task logs) should not bootstrap the full runtime. Direct repository access is sufficient.