-
Notifications
You must be signed in to change notification settings - Fork 81
[Server] Add tool name validation for SEP-986 #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements tool name validation according to the SEP-986 specification. The validation ensures tool names contain only allowed characters (a-z, A-Z, 0-9, dots, hyphens, underscores, forward slashes) and do not exceed 64 characters in length.
Key changes:
- Added a
NameValidatorclass to validate tool names against the SEP-986 specification - Integrated validation into the
Registryto log warnings for invalid tool names - Standardized debug message formatting to use double quotes instead of single quotes
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Capability/Tool/NameValidator.php | New validator class implementing tool name validation with regex pattern |
| src/Capability/Registry.php | Integrated name validator and standardized logging message format |
| tests/Unit/Capability/Tool/NameValidatorTest.php | Comprehensive test coverage for valid and invalid tool name cases |
| tests/Unit/Capability/Registry/RegistryTest.php | Updated test expectations to match new quote format in log messages |
| tests/Inspector/InspectorSnapshotTestCase.php | Removed unnecessary type hint comment |
| phpstan.dist.neon | Added exception for missing iterable value types in tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
beafd6d to
964d7a3
Compare
| - | ||
| identifier: missingType.iterableValue | ||
| path: tests/ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is addressing array shapes for DataProvider methods in tests - i don't think there is any value in defining them since it is only PHPUnit consuming those arrays not user land code.
Close #137