feat(server): pre-adapter validation against legacy schema (stage 4b2)#671
Merged
Conversation
When the buyer claims a legacy version that routes through the adapter path, validate the input against the buyer's claimed schema *before* the adapter runs. Legacy field paths surface in errors — easier to act on than v3 paths after translation. Flow when wire_version in LEGACY_ADAPTER_VERSIONS: 1. Lookup adapter; INVALID_REQUEST if missing. 2. (new) Validate params against the legacy schema: - strict: raise VALIDATION_ERROR with claimed_version in details - warn: log the violation and let the adapter try - off / no config: skip (zero-overhead path preserved) 3. Run adapter.adapt_request(params). 4. Post-adapter validation against the SDK pin (existing). Stage 4b1 bundled v2.5 schemas; this wires them into the dispatch path. Full versioned-schema-validation port complete. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Stage 4b2 — wires bundled v2.5 schemas (#670) into dispatcher pre-adapter validation. Legacy field paths surface in validation errors before adapter runs. 5 new tests; 4524 passed.