Skip to content

feat(server): pre-adapter validation against legacy schema (stage 4b2)#671

Merged
bokelley merged 1 commit into
mainfrom
claude/versioned-schemas-stage-4b2
May 11, 2026
Merged

feat(server): pre-adapter validation against legacy schema (stage 4b2)#671
bokelley merged 1 commit into
mainfrom
claude/versioned-schemas-stage-4b2

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

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.

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>
@bokelley bokelley merged commit 4ef032b into main May 11, 2026
16 checks passed
@bokelley bokelley deleted the claude/versioned-schemas-stage-4b2 branch May 11, 2026 13:07
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