feat(mcp): activate rule event tracking in core handlers (#1180)#1188
Merged
Conversation
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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeremyDev87
commented
Apr 3, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
Review: APPROVE
CI Status: PASS (25/25 checks)
Code Quality
- No
anytypes, 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
RuleEventCollectorinjected via constructor DI in all handlers- One
astype assertion in quality-report.handler.ts forresult.domains— acceptable for dynamic service return
Spec Compliance (issue #1180)
- parse_mode →
mode_activatedevent with mode + agent details - generate_checklist →
checklist_generatedevent per domain - dispatch_agents →
specialist_dispatchedevent per primary + parallel agent - pr_quality_report →
specialist_dispatchedevent per detected domain - agent_discussion →
specialist_dispatchedevent 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
commented
Apr 3, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
✅ Conductor Review — APPROVE
CI Status: ALL PASS (25/25)
Review: APPROVE — 0 issues found
Verification against PLAN:
-
parse_mode→mode_activatedevent with mode + agent -
generate_checklist→checklist_generatedper domain -
dispatch_agents→specialist_dispatchedper agent (primary + parallel) -
pr_quality_report→specialist_dispatchedper detected domain -
agent_discussion→specialist_dispatchedper specialist
Code Quality:
- Fire-and-forget pattern: try/catch blocks, never breaks handler
- No
anytypes - 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan