Repository navigation
fix(testing): backport echoed-release capability validation under an external pin root for SDK 15.9.x - #3323
Merged
Conversation
…external pin root for SDK 15.9.x Backport of #3322. Hosted compliance always runs with an external schema root for the pinned release, and the served-release rule from 15.9.2 let that root win over the echo. A 3.0 target therefore graded a conformant 3.2 get_adcp_capabilities response against 3.0: every storyboard response_schema check on that task failed (52 steps in the 3.0.27 suite), and discovery raised spurious capabilities_response_schema_invalid notices. For get_adcp_capabilities only, the storyboard response_schema check, discoverAgentProfile and TaskExecutor now validate against the echoed adcp_version when it is the pin's major, is listed in the response's own adcp.supported_versions, and has a schema root (one supplied for that release, an external root registered for it, or the SDK's bundled schemas), whether or not an external root is active for the pin. Otherwise they validate strictly against the pin. Other tasks, storyboard selection, the run's adcp_version and grading stay on the pin. New servedReleaseSchemaRoots option on comply(), runStoryboard() and runStoryboardStep(), and a withServedReleaseSchemaRoots() scope helper exported from @adcp/sdk/testing, let a hosted grader supply its own roots for echoed releases. They are activated only for that capabilities validation. Fixes #3320 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean backport of #3322 to 15.9.x, fixing #3320.
The #3287 served-release rule let the pin's external schema root win over the agent's echoed adcp_version, causing hosted compliance to grade a 3.2 capabilities response against a 3.0 pin (52 failed steps + spurious notices). The fix drops external-root-wins for get_adcp_capabilities only, selecting the echoed release when same-major + in supported_versions + a schema root exists, scoped via withServedValidationVersion.
Checked:
- Cache safety:
withServedValidationVersion(schema-loader.ts:744) merges the served root withoutclearStatesForBundle; safe becausestates/schemaRefValidatorsare keyed bystateCacheKey(bundleKey, root)— distinct root = distinct entry, no stale reuse. validateResponseSchemaAgainst(TaskExecutor.ts:153) is a verbatim extraction; only version source + scoping change.isExternalResponseSchemaAuthoritativewidening (validations.ts:691) is additive; both call sites pass a full ValidationContext.- Tests prove the correct root is selected over the bundled default and that served roots never leak across tasks; live-seller end-to-end comply() covered.
- Changeset present;
patchjustified for a maintenance-line backport that only selects validation version (no wire-shape change). Witness-not-translator preserved.
No blocking findings, no medium findings, no escalation triggers. gated_paths false, high_risk false, no team gate. Falls through to row 9.
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.
Summary
Backport of #3322 to
15.9.xfor thelatestdist-tag. Fixes #3320.Hosted compliance always runs
comply()with an external schema root for the pinned release. The served-release rule from 15.9.2 (#3287) let that root win over the agent's echoedadcp_version, so a 3.0 target graded a conformant 3.2get_adcp_capabilitiesresponse against 3.0. Every storyboardresponse_schemacheck on that task failed (52 steps across 43 storyboards in the 3.0.27 suite), and discovery raised spuriouscapabilities_response_schema_invalidnotices (worked around in adcontextprotocol/adcp#8264).For
get_adcp_capabilitiesonly, the storyboardresponse_schemacheck,discoverAgentProfileandTaskExecutornow validate against the echoed release when all of these hold:adcp.supported_versions;servedReleaseSchemaRoots, an external root registered for it, or the SDK's bundled schemas.This holds whether or not an external root is active for the pin. Otherwise validation stays strictly on the pin. Other tasks, storyboard selection, the run's
adcp_versionand grading are unchanged.There is a new
servedReleaseSchemaRootsoption (version → schema root) oncomply(),runStoryboard()andrunStoryboardStep(), and awithServedReleaseSchemaRoots(roots, fn)helper exported from@adcp/sdk/testing. Hosted callers use them to supply their own roots for echoed releases. Those roots are activated only for this capabilities validation. See #3322 for the full design notes.Differences from #3322
TaskExecutor: 15.9.x has no identity-3.3 validation branch, so the extractedvalidateResponseSchemaAgainstcallsvalidateIncomingResponsedirectly. That conflict is the only one. Everything else cherry-picked cleanly from both fix(testing): validate capabilities against the echoed release under an external pin root #3322 commits, which are squashed here.patch, so this ships as the next 15.9.x patch (15.9.5).Test plan
test/lib/capabilities-echoed-release-hosted-validation.test.js(24 tests). Against unpatched15.9.x, 17 fail; the 7 that pass are the pin-fallback guards. With the fix all pass, including the end-to-endcomply()run in the hosted shape (version: '3.0.25'plus an external 3.0schemaRoot).test/lib/capabilities-served-release-validation.test.jsupdated for the newsupported_versionscondition (17 tests, all pass).npm run typecheck,build:libnpm run test:nodelocally. Every suite passes except the Postgres-backed ones (ECONNREFUSED, no local database), which CI covers.🤖 Generated with Claude Code