Skip to content

Validate enum wire fields#266

Closed
leehack wants to merge 1 commit into
spec/role-wire-validationfrom
spec/enum-wire-validation
Closed

Validate enum wire fields#266
leehack wants to merge 1 commit into
spec/role-wire-validationfrom
spec/enum-wire-validation

Conversation

@leehack

@leehack leehack commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • add shared enum wire-value parsing for protocol enum fields
  • reject malformed logging levels and sampling enum fields with FormatException
  • validate toolChoice.mode during request parsing while preserving legacy raw map storage

Validation

  • dart format lib/src/types/validation.dart lib/src/types/logging.dart lib/src/types/sampling.dart test/types/logging_types_test.dart test/types/sampling_test.dart test/mcp_2025_11_25_test.dart
  • dart test test/types/logging_types_test.dart test/types/sampling_test.dart test/mcp_2025_11_25_test.dart
  • dart analyze
  • git diff --check
  • dart test
  • dart pub global run coverage:test_with_coverage

Stacked on #265. This remains a draft RC PR and stays off main until the official spec release.

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.81%. Comparing base (f891c10) to head (e12088a).

Additional details and impacted files
@@                      Coverage Diff                      @@
##           spec/role-wire-validation     #266      +/-   ##
=============================================================
+ Coverage                      88.79%   88.81%   +0.02%     
=============================================================
  Files                             47       47              
  Lines                           9621     9632      +11     
=============================================================
+ Hits                            8543     8555      +12     
+ Misses                          1078     1077       -1     
Flag Coverage Δ
unittests 88.81% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leehack

leehack commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

Closing this draft micro PR because the RC spec work has been consolidated into a smaller reviewable stack. This change is preserved in #271 (type/schema validation); the consolidated tip is tree-identical to the previous micro-stack tip.

@leehack leehack closed this Jun 1, 2026
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