P12-T3: Add Error Classification & Categorization#52
Merged
SoundBlaster merged 8 commits intoFeb 15, 2026
Conversation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… breakdown chart Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…etrics.py Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Description
Implements P12-T3: error classification and categorization for JSON-RPC responses.
categorize_error(code)helper mapping error codes to buckets:protocol(-32600…-32699),timeout(-32001),tool(≥1),unknownMetricsCollectorandSharedMetricsStorewitherror_counts_by_codetrackingrecord_response()in both stores to accepterror_codeanderror_messageget_error_code()/get_error_message()accessors toMCPResponseinschemas.pyerror_code/error_messagecolumns to SQLiterequeststable with backward-compatible migrationerror_codeanderror_messagethrough__main__.pyresponse handler andAuditLoggerchart-error-breakdowncanvas).error-protocol(red),.error-tool(orange),.error-timeout(yellow),.error-unknown(grey)Follow-up tasks created: FU-P12-T3-1 (document unused
error_messagein in-memory collector), FU-P12-T3-2 (adderror_codeto CSV audit export).Type of Change
Quality Gates
Before submitting, ensure all quality gates pass:
Or run individually:
make test- All tests pass with ≥90% coverage — 437 passed, 5 skipped; 96.09% coveragemake lint- No linting errors —ruff check src/: all checks passedmake format- Code is properly formattedmake typecheck- Type checking passes —mypy src/: no issues in 13 source filesmake doccheck- Documentation is synced with DocC (if docs changed)Documentation Sync
Testing
TestCategorizeError(9 tests) — boundary coverage for all categoriesTestParseErrorInfo(5 tests) — success, error with code/message, invalid JSONtest_error_counts_by_code_*(5 tests intest_metrics.py, 5 intest_shared_metrics.py)Checklist