Skip to content

feat(mcp): activate rule event tracking in core handlers (#1180)#1188

Merged
JeremyDev87 merged 1 commit into
masterfrom
taskmaestro/1775205842/pane-2
Apr 3, 2026
Merged

feat(mcp): activate rule event tracking in core handlers (#1180)#1188
JeremyDev87 merged 1 commit into
masterfrom
taskmaestro/1775205842/pane-2

Conversation

@JeremyDev87

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Integration tests for event emission in each handler
  • Verify existing handler tests still pass
  • Verify rule-stats.json writes

Instrument 5 core MCP handlers with RuleEventCollector for rule-stats.json:
- mode.handler: mode_activated events with mode and agent details
- checklist-context.handler: checklist_generated events per domain
- agent.handler: specialist_dispatched events per agent dispatched
- quality-report.handler: specialist_dispatched events per domain detected
- discussion.handler: specialist_dispatched events per specialist

All events use fire-and-forget pattern (try/catch, never break handler).
@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 3, 2026 9:41am

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: APPROVE

CI Status: PASS (25/25 checks)

Code Quality

  • No any types, no unused imports, no dead code
  • Consistent fire-and-forget pattern across all 5 handlers: try { record() } catch { /* never break */ }
  • Handler return values unchanged — events recorded after result computation, before return
  • RuleEventCollector injected via constructor DI in all handlers
  • One as type assertion in quality-report.handler.ts for result.domains — acceptable for dynamic service return

Spec Compliance (issue #1180)

  • parse_mode → mode_activated event with mode + agent details
  • generate_checklist → checklist_generated event per domain
  • dispatch_agents → specialist_dispatched event per primary + parallel agent
  • pr_quality_report → specialist_dispatched event per detected domain
  • agent_discussion → specialist_dispatched event per specialist
  • All existing tests pass

Test Coverage (16 new tests)

  • Each handler has: normal emission, no events on failure, handler resilience when record throws
  • agent.handler has additional parallel dispatch test
  • Integration spec and mcp.service.spec properly updated with mock

Issues Found

None.

Recommendation: APPROVE

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Conductor Review — APPROVE

CI Status: ALL PASS (25/25)

Review: APPROVE — 0 issues found

Verification against PLAN:

  • parse_modemode_activated event with mode + agent
  • generate_checklistchecklist_generated per domain
  • dispatch_agentsspecialist_dispatched per agent (primary + parallel)
  • pr_quality_reportspecialist_dispatched per detected domain
  • agent_discussionspecialist_dispatched per specialist

Code Quality:

  • Fire-and-forget pattern: try/catch blocks, never breaks handler
  • No any types
  • No unused imports
  • All existing tests pass with added RuleEventCollector mock
  • New tests: 3 per handler (success/failure/throws)
  • Constructor DI consistent across all handlers

@JeremyDev87 JeremyDev87 self-assigned this Apr 3, 2026
@JeremyDev87 JeremyDev87 merged commit 9660efe into master Apr 3, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the taskmaestro/1775205842/pane-2 branch April 3, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): activate rule event tracking in core handlers

1 participant