Skip to content

fix(adagents): validator requires authorization_type per v3 schema - #4477

Merged
bokelley merged 1 commit into
mainfrom
bokelley/adagents-validator-auth-type
May 12, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/adagents-validator-auth-type

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • AdAgentsManager.validateAgent now enforces the v3 schema's oneOf invariant on every authorized_agents[] entry: authorization_type plus a non-empty matching selector (property_ids, property_tags, properties for inline_properties, publisher_properties, signal_ids, signal_tags).
  • Per-entry error messages name the missing field path (authorized_agents[0].authorization_type) and list the valid selector enums, so publishers can locate and fix the gap.
  • The /adagents Quick Start example was on a stale schema (publisher_domain at root, authorized_for as an array, no authorization_type) — replaced with a v3-correct example. docs/governance/property/adagents.mdx field reference flips authorization_type from "optional" to "required" with the selector-pairing rule called out.

Before this change, files like wonderstruck.org's adagents.json (and Raptive's, and others') returned valid: true from the online validator — while the Python and TS SDKs correctly read the entries as unauthorized. Publishers saw "valid" and assumed they were done; buyers saw "agent not authorized." The validator was the source of the disagreement.

Closes #4476.

Test plan

  • vitest run tests/unit/adagents-manager.test.ts — 92/92 pass, including three new tests covering: the exact wonderstruck.org repro, authorization_type present without selector, and selector present as empty array.
  • Updated one previously-passing test that asserted the old warning-only behavior (signal_ids type with no signal_ids array) to expect the new error.
  • Existing managerdomain-fallback fixtures updated to declare authorization_type on the manager-served manifest so those tests still exercise the scope-rejection path rather than failing at structural validation.
  • Spot-check the /adagents landing page renders the new Quick Start example correctly.

🤖 Generated with Claude Code

Every authorized_agents[] entry must declare authorization_type plus the
matching non-empty selector (property_ids, property_tags, properties for
inline_properties, publisher_properties, signal_ids, signal_tags) —
that's the v3 schema's oneOf invariant. Files that omitted it (e.g.
wonderstruck.org's bare {url, authorized_for} entries) used to return
valid:true while downstream resolvers correctly read them as
unauthorized, so publishers saw "valid" while buyers saw "agent not
authorized." Per-entry errors now name the missing field and list the
valid selector enums.

Also updates the /adagents Quick Start example (which was on a stale
schema and was the source publishers copy from) and the reference docs
to flag authorization_type as required. Closes #4476.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley merged commit a972dbf into main May 12, 2026
18 checks passed
@bokelley
bokelley deleted the bokelley/adagents-validator-auth-type branch May 12, 2026 22:20
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.

Validator reports invalid adagents.json as valid (missing authorization_type)

1 participant