Skip to content

P12-T3: Add Error Classification & Categorization#52

Merged
SoundBlaster merged 8 commits into
mainfrom
feature/P12-T3-error-classification-categorization
Feb 15, 2026
Merged

P12-T3: Add Error Classification & Categorization#52
SoundBlaster merged 8 commits into
mainfrom
feature/P12-T3-error-classification-categorization

Conversation

@SoundBlaster

Copy link
Copy Markdown
Owner

Description

Implements P12-T3: error classification and categorization for JSON-RPC responses.

  • Adds categorize_error(code) helper mapping error codes to buckets: protocol (-32600…-32699), timeout (-32001), tool (≥1), unknown
  • Extends MetricsCollector and SharedMetricsStore with error_counts_by_code tracking
  • Extends record_response() in both stores to accept error_code and error_message
  • Adds get_error_code() / get_error_message() accessors to MCPResponse in schemas.py
  • Adds error_code / error_message columns to SQLite requests table with backward-compatible migration
  • Passes error_code and error_message through __main__.py response handler and AuditLogger
  • Adds error breakdown doughnut chart to dashboard (chart-error-breakdown canvas)
  • Color-codes audit table error column by severity: .error-protocol (red), .error-tool (orange), .error-timeout (yellow), .error-unknown (grey)

Follow-up tasks created: FU-P12-T3-1 (document unused error_message in in-memory collector), FU-P12-T3-2 (add error_code to CSV audit export).

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • CI/CD improvement

Quality Gates

Before submitting, ensure all quality gates pass:

make check

Or run individually:

  • make test - All tests pass with ≥90% coverage — 437 passed, 5 skipped; 96.09% coverage
  • make lint - No linting errors — ruff check src/: all checks passed
  • make format - Code is properly formatted
  • make typecheck - Type checking passes — mypy src/: no issues in 13 source files
  • make doccheck - Documentation is synced with DocC (if docs changed)

Documentation Sync

  • Documentation changes are synced with DocC catalog (or N/A) — no docs/ changes

Testing

  • Added/updated tests for new functionality
    • TestCategorizeError (9 tests) — boundary coverage for all categories
    • TestParseErrorInfo (5 tests) — success, error with code/message, invalid JSON
    • test_error_counts_by_code_* (5 tests in test_metrics.py, 5 in test_shared_metrics.py)
  • All tests pass locally
  • Manually tested the changes

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated (if needed)
  • No new warnings generated
  • PR title is descriptive

SoundBlaster and others added 8 commits February 15, 2026 22:02
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>
@SoundBlaster SoundBlaster merged commit 127842d into main Feb 15, 2026
9 checks passed
@SoundBlaster SoundBlaster deleted the feature/P12-T3-error-classification-categorization branch February 15, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant