Agent: programmer (
programmer)
Confidence: 44%
Cost: $0.5430
Duration: 1m 45s
Task ID:51bdb538-25ca-46d6-9acd-75970f2fb4b4
Commit succeeded (warning about scope is non-blocking — event-bus isn’t in the scope enum, but core would be the standard scope; the commit still went through).
Summary
SPEC-33 complete. Added two diagnostic methods to TypedEventBus in src/core/event-bus.ts:
| Method | Signature | Purpose |
|---|---|---|
listenerCount() |
listenerCount<K>(event: K): number |
Returns handler count for a specific event |
listenerCounts() |
listenerCounts(): Record<string, number> |
Returns all event handler counts |
Key implementation detail: The plan’s code used this.listeners and .length, but the actual codebase uses this.handlers (a Map<string, Set<Handler>>), so the methods use .size instead.
Files changed:
src/core/event-bus.ts— +12 lines (two methods)tests/unit/event-bus.test.ts— +31 lines (4 new test cases)
Verification: tsgo --noEmit clean, 12/12 tests pass.
—HANDOFF—
TO: reviewer
INTENT: handoff
ARTIFACT_TYPE: code-change
SUMMARY: SPEC-33 — Added listenerCount(event) and listenerCounts() diagnostic methods to EventBus with 4 unit tests