Skip to content

fix(compliance): canonicalize format-id agent_url in pagination storyboard - #7652

Merged
bokelley merged 1 commit into
adcontextprotocol:3.1.xfrom
sujanchalla0510:fix/canonical-format-agent-url-3.1.x
Sep 23, 2026
Merged

bokelley merged 1 commit into
adcontextprotocol:3.1.xfrom
sujanchalla0510:fix/canonical-format-agent-url-3.1.x

Conversation

@sujanchalla0510

Copy link
Copy Markdown
Contributor

Summary

The secondary, in-repo half of #7367: make the get_products_pagination_integrity storyboard's format-id values canonical on the 3.1.x line, so a schema-conformant seller can satisfy it without waiting on the cross-repo runner fix.

core/format-id.json states the requirement on the comparing side:

Callers comparing two format-id values MUST canonicalize agent_url per the AdCP URL canonicalization rules before treating two formats as the same.

and docs/reference/url-canonicalization.mdx step 5 is explicit about what that does to this value:

If the path is empty AND an authority is present, substitute / (RFC 3986 §6.2.3; https://host?x=1 → https://host/?x=1).

The storyboard seeds and compares "https://compliance.adcontextprotocol.org" — empty path, authority present. A seller that follows the MUST emits "https://compliance.adcontextprotocol.org/", and the step can only pass by emitting a deliberately non-canonical URL.

Verified against the runner the 3.1.x line actually pins

@adcp/sdk 9.6.2 (this branch's package.json pin), dist/lib/testing/storyboard/validations.js:595:

function valuesMatch(actual, expected) {
    if (typeof actual === 'object' && actual !== null) {
        return JSON.stringify(actual) === JSON.stringify(expected);
    }
    return actual === expected;
}

No canonicalization on either side. Replaying that function against the fixture:

conformant seller vs fixture BEFORE: false
conformant seller vs fixture AFTER : true

A seller emitting the non-canonical form now fails, which is the correct outcome per the format-id MUST.

Scope: six occurrences, not two

The triage names the seeded fixtures and the wholesale_first_page field_contains value. Reading the file, the same value appears in six places across three roles, and the request filters matter as much as the assertions — a filter asking for the non-canonical form may not select the product on a seller that canonicalizes on ingest:

Lines Role
70, 80 seeded product fixtures
169, 242 get_products request filters (filters.format_ids)
191, 265 field_contains values — wholesale_first_page and wholesale_terminal_page

wholesale_terminal_page carries the identical assertion and is affected identically; it isn't mentioned in the issue or the triage.

Supporting evidence for the canonical form being the right target

The bundle disagrees with itself today. Across static/compliance/source on this branch, agent_url: "https://creative.adcontextprotocol.org/" appears 9 times and the non-canonical spelling 4 times; canonical_formats.yaml — the storyboard whose whole subject is canonical formats — uses the trailing-slash form. This change moves the pagination storyboard onto the same side.

Patch eligibility

Patch-eligible conformance correction, same shape as #7554 and #7572: it corrects fixture values so a previously-unsatisfiable assertion becomes satisfiable by a conformant seller. No new steps, no step-kind changes, no protocol surface added, and no previously-conformant response is newly rejected — a seller that was passing this step was necessarily emitting a non-canonical agent_url, which the format-id description already forbids relying on.

main needs no equivalent change: it has migrated this storyboard to format_options and no longer compares agent_url here.

Validation

  • npm run build:compliance — clean, all storyboard lints pass; regenerated dist/compliance/latest/ carries 6 canonical and 0 non-canonical occurrences
  • tests/lint-compliance-source-authority, lint-compliance-packaged-refs, lint-storyboard-contradictions, lint-storyboard-check-enum — 52 assertions, all pass
  • Full npm run precommit — 62/62 root tests, 285/285 server test files (4365 passed, 30 skipped)

One note on the last item, since it cost some time and may bite the next contributor: running the precommit on this branch in a working tree whose node_modules was installed from main produces 310 unrelated failures across server/tests/unit/ (training-agent, idempotency, storyboard-fix-plan-e2e). Reproduced on unmodified upstream/3.1.x with an empty diff, so it is not caused by any change — main resolves @adcp/sdk at 14.x while this branch pins 9.6.2. npm ci on the branch clears all of it.

Partially addresses #7367. The runner-side fix in adcp-client (canonicalize both sides for format: uri fields) remains the general remedy for every other uri-typed comparison and is unaffected by this.

🤖 Generated with Claude Code

…board

core/format-id.json states that callers comparing two format-id values
MUST canonicalize agent_url first, and url-canonicalization.mdx step 5
substitutes "/" for an empty path when an authority is present. The
get_products_pagination_integrity storyboard seeds and compares
"https://compliance.adcontextprotocol.org" with no path, so a seller
that follows that MUST emits the trailing-slash form and fails the
runner's raw string comparison. The step could only pass by emitting a
deliberately non-canonical URL.

Corrects all six occurrences in the storyboard: both seeded product
fixtures, both get_products request filters, and the field_contains
values on wholesale_first_page and wholesale_terminal_page.

The bundle was also self-inconsistent: canonical_formats.yaml already
uses the canonical "https://creative.adcontextprotocol.org/" form.

Partially addresses adcontextprotocol#7367. Runner-side canonicalization in adcp-client
remains the general fix for every other uri-typed comparison.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@sujanchalla0510
sujanchalla0510 requested a review from a team as a code owner September 22, 2026 22:52

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean conformance fix on 3.1.x, no findings.

Checked: canonicalizes format_ids[].agent_url (trailing slash per url-canonicalization step 5 / format-id MUST) across all six occurrences in get-products-pagination-integrity.yaml; all sites patched with no stray references; only widens the passing set (no contract break); patch-scoped changeset present and correct.

No blocking or medium findings. No high-risk paths, no gated paths, no author team gate. Falls through to row 9.

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.

2 participants