Repository navigation
test(compliance): cover canonicalization step 5 for an empty path with no query - #8076
Merged
bokelley merged 2 commits intoOct 9, 2026
Conversation
Step 5 reads "If the path is empty AND an authority is present, substitute `/`". The query is not part of that condition -- it appears only in the step's illustrative example, `https://host?x=1` to `https://host/?x=1`. The vector set could not tell the two readings apart. Of its 37 cases exactly one had an empty path, and that one carried `?x=1`, so an implementation that gated step 5 on the query passed 37 of 37 while emitting `https://host` for `https://host`. Four cases close it: the bare authority, a non-default port, an IPv6 literal, and the empty-query spelling where steps 5 and 7 compose to `https://host/?`. Measured against the Python SDK, these four fail before its step-5 fix and pass after it, with the original 37 green throughout.
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, purely-additive conformance-vector PR.
What I checked:
- Adds four URL-canonicalization conformance vectors to
canonicalization.jsoncovering step 5 (empty path + authority →/) with no query present: bare authority, non-default port, IPv6 literal, and empty-query (https://host?→https://host/?, steps 5 + 7 composing). - Reviewer verified each
expected_target_uri/expected_authorityagainst url-canonicalization.mdx steps 2/4/5/7 — all correct. - No wire/normative change, docs already correct and untouched, no dist mutation,
rulestrings anchor to normative spec steps per DR-0001. patchchangeset is appropriate for a non-normative test-vector addition; no hardcoded vector count needs updating.
Decision-table walk: No critical/high/medium findings (row 1 N/A). gated_paths: false (row 2 N/A). high_risk: false (rows 3/5 N/A). No medium findings (rows 4/8 N/A). No prior escalation (row 6 N/A). No no-auto-approve team match (row 7 N/A). Falls through to row 9 → approve.
Note: review_decision is REVIEW_REQUIRED, but since gated_paths is false and no prose hard gate applies (no schema/normative/breaking change), this does not block approval.
bokelley
added a commit
that referenced
this pull request
Oct 9, 2026
Add impressions-optional delivery rows (#8108) to the versioning exceptions and migration guide, expected_confirmation_at on refine_proposals (#8104), SDK implementation metadata (#8079), unsupported-targeting-dimension details (#8052), experimental trust.json schemas (#8067), the Reliable Reporting compaction notice and REVISION_UNREADABLE (#8100, #8099), the sales-broadcast-tv 1.1.0 tightening (#8046), new signing and canonicalization vectors (#8068, #8076), and training-agent fixtures (#8106, #8078, #8012). Regenerate the In-review table from the 56 open 3.3.0 milestone issues. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 9, 2026
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.
The gap
Step 5 of the URL-canonicalization algorithm reads, in
docs/reference/url-canonicalization.mdx:The condition is "path empty AND authority present". The query appears only in the illustrative example.
test-vectors/request-signing/canonicalization.jsonhas 37 cases, and exactly one has an empty path:{ "name": "empty-path-with-authority-becomes-slash", "rule": "step 5: empty path with authority → /", "input_url": "https://seller.example.com?x=1", "expected_target_uri": "https://seller.example.com/?x=1", "expected_authority": "seller.example.com" }That case carries
?x=1. So an implementation that reads the example as the condition — gating the substitution on the query rather than on the path and authority — scores 37/37 while diverging, emittinghttps://hostforhttps://hostwhere step 5 and RFC 3986 §6.2.3 both requirehttps://host/.This is not hypothetical. The Python SDK had precisely that gating (
if not path and parts.query), and it passed the full published set:Since the set cannot distinguish the two readings, each new implementation is free to pick the wrong one and be told it conformed.
The four cases
No normative change —
url-canonicalization.mdxis untouched, because the text is already correct. This is detection only.@target-uriempty-path-no-query-becomes-slashhttps://seller.example.comhttps://seller.example.com/empty-path-no-query-non-default-port-becomes-slashhttps://seller.example.com:8443https://seller.example.com:8443/seller.example.com/:8443empty-path-no-query-ipv6-becomes-slashhttps://[2001:db8::1]https://[2001:db8::1]/empty-path-empty-query-becomes-slashhttps://seller.example.com?https://seller.example.com/?The last one is worth its place: it is where a query-gated reading fails on its own terms. The raw URL does carry a
?, but a parser reports the query as the empty string, so a condition written against the query reads false and the output is a path-lesshttps://seller.example.com?— a form no RFC 3986 normalizer produces. Step 5 supplies the/and step 7 preserves the trailing?.Each case carries a
rulenaming the step it exercises and a$commentsaying what a wrong implementation does instead, matching the conventions of the surrounding cases.Why it matters beyond signing
The page's own "Where it applies" table makes this one algorithm the identifier comparer for
adagents.jsonauthorized_agents[].url,brand.jsonagents[].url, TMPseller_agent.agent_url,ProviderEntry.agent_url,format-id.agent_urland the governance-agent acceptance list. Under the query-gated reading:Two spellings of one URL become two identifiers. A publisher who registers an agent without a trailing slash does not match a caller that arrives with one, and the refusal reads as an authorization failure rather than a canonicalization one. On the signing path the same divergence shifts the
@target-uriline of the signature base by one byte, which is the failure the vector README describes as the #1 silent 9421 interop bug.Verification
Measured against the Python SDK with the step-5 condition corrected and with it left as-is:
In both runs the original 37 cases behave identically, so the addition is purely additive — it cannot change the verdict for an implementation that was already right. The four failures are all on
expected_target_uri;expected_authoritymatches in every case, which is the cross-check on the authority values written here.node scripts/check-changeset-protocol-scope.cjs origin/mainandnode scripts/lint-compliance-source-authority.cjsboth pass. Apatchchangeset is included;dist/is untouched, since the built bundles are generated and only frozen released versions are committed.The companion SDK fix is proposed separately at
https://github.com/adcontextprotocol/adcp-client-python/pull/1456. These vectors stand on their own, though — any implementation is free to be measured by them regardless of what that PR does.