Rename ContextDefinitionNormalizer now that it normalizes input and output definitions
Problem/Motivation
The definition families no longer build on core's context system (#3583016 (closed)). #3583018 (closed) retargeted Drupal\tool\Normalizer\ContextDefinitionNormalizer to them rather than renaming it. It is now the JSON Schema builder for every input and output definition: getSupportedTypes() lists InputDefinitionInterface and OutputDefinitionInterface, and keeps ContextDefinitionInterface only for the ai module's setContextDefinitionOverride() path (and the output acceptance shim, #3583050).
The name and the class docblock still describe the old role ("Normalizes ContextDefinition objects … commonly used in plugin systems and typed data definitions"). It reads as a context-system class, which invites questions like whether a separate input normalizer exists with the same logic. It does not: this class is the only place input and output schemas are built.
Proposed resolution
Rename the class, its service and its docblock to describe what it normalizes, before rc1 freezes the names.
- Class: the name is open. It should say it normalizes input and output definitions, in line with
ToolInputDefinitionNormalizeEvent,ToolOutputDefinitionNormalizeEventandToolDefinitionNormalizeDirection. AvoidToolDefinitionNormalizer:ToolDefinitionis the plugin definition, andToolDefinitionSerializeralready serializes it. - Service ID:
tool.normalizer.context_definitionin tool.services.yml. - Docblock: describe the input and output definition families as the subject, and the core context definition support as the ai override path.
- References to update:
LegacyTypedDataNormalizer(ContextDefinitionNormalizer::DECIMAL_PATTERN), the comments inEntityHandleTransformerandEffectiveDataDefinition, andNormalizerFormatRestrictionTest.
Nothing outside Tool API refers to the class or the service ID: tool_belt, canvas_tools and mcp_server_tool_bridge do not. #3582966 already proposes marking the normalizers @internal. If that lands first, the rename needs no deprecation layer; otherwise keep a deprecated alias of the class and the service for one release.
Remaining tasks
- Choose the name.
- Rename, update the references and the docblock.
- Coordinate with #3582966.
AI usage (if applicable)
- AI Assisted Issue: This issue was generated with AI assistance, but was reviewed and refined by the creator.
- AI Assisted Code: This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.
- AI Generated Code: This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.
- Vibe Coded: This code was generated by an AI and has only been functionally tested.