Repository navigation
spec(errors): register AGENT_SUSPENDED / AGENT_BLOCKED + consolidate 3.0.5 details.status placeholder (closes #3871) - #3906
Merged
Conversation
…tus axis on agent-permission-denied (closes #3871) Two new error codes for the per-buyer-agent commercial-status axis (sibling to ACCOUNT_SUSPENDED / CAMPAIGN_SUSPENDED, scoped to the agent-relationship), both recovery: terminal. The code itself is the discriminator — no explicit error.details.scope field, no error.details payload, mirroring BILLING_NOT_PERMITTED_FOR_AGENT. agent-permission-denied.json simplified: status:[suspended,blocked] axis removed (those states live on the dedicated codes now); only scope:"agent" + reason:"sandbox_only" remains. oneOf exclusivity drops out (single payload axis), reason becomes required. Closes the DX-expert "wire-level recovery field ambiguity" gap from #3887 review for suspended/blocked — those paths now carry recovery: terminal directly. Same cross-tenant onboarding oracle clamp + channel-coverage rules established in #3887 apply uniformly to all three paths (AGENT_SUSPENDED / AGENT_BLOCKED / PERMISSION_DENIED+scope:agent+sandbox_only). Per-Agent Authorization Gate subsection rewritten to cover all three under a single normative bullet list. Composition-pattern guidance added: lifecycle-terminal states get codes; transient/throttling-shaped rejections reuse RATE_LIMITED + reason rather than minting new per-agent codes. Files: - error-code.json: AGENT_SUSPENDED / AGENT_BLOCKED enum + descriptions + enumMetadata. PERMISSION_DENIED description updated to point at new codes. - agent-permission-denied.json: status field removed, oneOf removed, reason now required. - error-handling.mdx: Authorization (RBAC) table adds new code rows; Per-Agent Authorization Gate subsection rewritten + dispatch example uses optional chaining for defensive copy-paste safety. The status field shipped in #3887 was only present in dist/schemas/latest/ and never frozen into a tagged release (3.0.4 is current; 3.0.5 docs entry exists but no tarball) — safe to amend dev state without a deprecation window. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ded-blocked-codes # Conflicts: # static/schemas/source/error-details/agent-permission-denied.json
…don't remove 3.0.5 shipped agent-permission-denied.json with status:[suspended,blocked] to consumers. Removing it in 3.0.6 would be a breaking schema change for anyone pinned to 3.0.5. Reshape to a deprecation pattern instead: - AGENT_SUSPENDED / AGENT_BLOCKED added (additive — new codes are patch-safe; consumers handle unknown codes via recovery classification). - agent-permission-denied.json keeps the status field with deprecated:true annotation, oneOf exclusivity preserved (status XOR reason). - Description and PERMISSION_DENIED enumDescription flag the deprecation timeline: sellers SHOULD emit dedicated codes from 3.0.6; status removal scheduled for 3.1. - Per-Agent Authorization Gate subsection rewritten to document the dual-pathway state during deprecation; dispatch example handles both the new dedicated codes and the back-compat status form. Changeset bumped from --empty to patch (this is a registered-protocol change, not infra/docs). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…relative timeline Protocol + security re-review of #3906 deprecation reshape returned accept-with-comments. Addressing: - Security Medium (form consistency): added normative bullet to error-handling.mdx Per-Agent Authorization Gate. Sellers MUST choose one form (dedicated codes vs PERMISSION_DENIED+status) per agent state and emit it consistently across all surfaces, tasks, and replicas — mixed-form rollouts let callers fingerprint partial-rollout boundaries which can correlate to tenant cohorts. - Drift across 4 loci: trimmed deprecation timeline from schema description and field-level description to single canonical home in error-handling.mdx (per protocol-expert recommendation). - Dispatch example: added "dedicated code wins" comment so SDK authors copying the inner branches in isolation don't misread the precedence. - Version language: scrubbed "3.0.6"/"in 3.1" specifics. The next release will be 3.1.0 (minor) given the existing minor-changeset queue, so version-specific deprecation language was wrong. Replaced with release-relative wording: "removal scheduled for no earlier than the minor release after the one in which the dedicated codes ship." No ship-blockers from either reviewer; remaining items (PERMISSION_DENIED description length trim, schema example $comment) are deferred as separate cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ion in 3.1 Reverting the deprecation reshape. Deprecation made sense if we were threading 3.0.6 → 3.1 → 3.2, but the changeset queue already has many minor entries — the next cut is 3.1.0 regardless. Carrying details.status as a deprecated alias through 3.1 → 3.2 (or further) is ceremony for a field that's been in the wild for 12 hours with one Phase-1 placeholder adopter. Better to land cleanly: drop status, document the 3.0.5 → 3.1 placeholder consolidation in the migration note. - agent-permission-denied.json: status field removed, oneOf removed, reason required. - error-code.json PERMISSION_DENIED: deprecation language stripped; description points at AGENT_SUSPENDED / AGENT_BLOCKED for the suspended/blocked states. - error-handling.mdx: Per-Agent Authorization Gate back to clean three-paths shape; dual-pathway dispatch removed; added migration note flagging the 3.0.5 → 3.1 placeholder consolidation. - Changeset bumped to minor (matches the actual release semantics) and rewritten to lead with the placeholder-consolidation framing. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 3, 2026
Contributor
Author
|
Heads-up issues filed on the SDKs flagging the 3.0.5 → 3.1 placeholder consolidation:
The known adopter (BuyerAgentRegistry, adcontextprotocol/adcp-client#1269) is in Phase 1 placeholder mode, but anyone could pick up 3.0.5 between now and 3.1 cutting — the issues give SDK adopters the heads-up before the schema flip. |
Contributor
Author
|
Noted — SDK tracking issues logged:
Good to have these cross-linked before 3.1 cuts, especially given the Phase-1-placeholder window. No action needed here; this PR can proceed normally once CI is green. Generated by Claude Code |
Contributor
Author
|
Acknowledged — cross-repo trackers noted (adcp-client#1406, adcp-client-python#409, adcp-go#110). Standing by for CI green before merge. Generated by Claude Code |
5 of 6 tasks
bokelley
added a commit
to adcontextprotocol/adcp-client-python
that referenced
this pull request
May 20, 2026
…es (closes #409) (#748) AdCP 3.1 (PR adcontextprotocol/adcp#3906, released as 3.1.0-beta.1) consolidates the 3.0.5 PERMISSION_DENIED + details.status placeholder for per-buyer-agent commercial-status rejections into dedicated codes AGENT_SUSPENDED and AGENT_BLOCKED (recovery="terminal", no details payload — the code itself is the discriminator, mirroring BILLING_NOT_PERMITTED_FOR_AGENT). Wire shape change in _resolve_buyer_agent: - recognized + suspended: PERMISSION_DENIED + details.status="suspended" + recovery="correctable" -> AGENT_SUSPENDED + recovery="terminal" - recognized + blocked: PERMISSION_DENIED + details.status="blocked" + recovery="correctable" -> AGENT_BLOCKED + recovery="terminal" - unrecognized paths (registry miss / no credential / unknown status): unchanged - still PERMISSION_DENIED with no details (cross-tenant onboarding-oracle clamp preserved). The recovery="correctable" -> "terminal" flip is the spec's corrective fix: the placeholder inherited PERMISSION_DENIED's correctable hint, which contradicted the no-retry MUST for commercial-status rejections. Uses the established KNOWN_NON_SPEC_CODES allowlist pattern (same precedent as BILLING_NOT_PERMITTED_FOR_AGENT) - ADCP_VERSION stays pinned at 3.0.7. Allowlist entries carry TODO-on-3.1-bundle-bump markers so they auto-drop when the SDK eventually bumps to 3.1. BREAKING (narrow): PermissionDeniedError(status=...) is removed. The status field is gone from error-details/agent-permission-denied.json in 3.1. Migrate to: raise AdcpError("AGENT_SUSPENDED", recovery="terminal") for per-agent commercial status, or PermissionDeniedError(scope="agent", reason="sandbox_only") for the remaining provisioning gate. Passing status= now raises TypeError with a migration message; an explicit **details guard prevents the kwarg from silently landing in error.details and emitting a wire-invalid response. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
bokelley
added a commit
that referenced
this pull request
May 22, 2026
…4912) * chore(deps): bump @adcp/sdk 7.7 → 7.10.2 Catches up on the 7.x line. Headline gains: - 7.8 storyboard runner: `impairment.coherence` grades audience inverse rule (was deferred) and walks `creative_approvals[]` on buy snapshots alongside the request-side `creative_assignments[]`. - 7.8 server: `ctx.input` exposed on v6 platform methods — fixes the silent-drop bug where `sync_creatives`/`sync_audiences`/`sync_accounts` lost `assignments[]`, `delete_missing`, `dry_run`, `validation_mode` (adcp-client#1842). Adoption in our v6 shims is a follow-up. - 7.9 server: `pgCtxMetadataStore` round-trips the `resource` field; optional Redis backend for the idempotency store. - 7.10 client: `fetchAgentAuthorizationsFromDirectory` for AAO inverse lookup (adopts #4828); typed `AGENT_SUSPENDED`/`AGENT_BLOCKED` codes (adopts #3906). 7.10.0 and 7.10.1 shipped the new `v2/projection` cluster (Creative Formats v2, RFC #3305) with packaging gaps that crashed `get_products` storyboards on `/sales`. Both fixed: - 7.10.1 vendors `aao-reference-formats.json` next to the catalog loader (adcp-client#1909). - 7.10.2 patches the registry loader candidate paths to read from `dist/lib/schemas-data/<version>/registries/` where the SDK actually ships `v1-canonical-mapping.json` (adcp-client#1917). Matrix on 7.10.2: /signals 81 / 111 (floor 74 / 111) /sales 78 / 402 (floor 74 / 380) /governance 80 / 155 (floor 73 / 151) /creative 79 / 177 (floor 73 / 169) /creative-builder 76 / 152 (floor 70 / 146) /brand 80 / 96 (floor 73 / 96) Typecheck and the 7 SDK-touching unit-test files (64 tests) green. Storyboard floors held without changes; ratcheting them is a separate follow-up once CI confirms the new numbers on a couple of runs. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * chore: add changeset for @adcp/sdk 7.10.2 bump Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(training-agent): thread dry_run + assignments through v6 shims via ctx.input The v6 SDK's typed platform-method signatures destructure the request envelope and pass only the typed first-arg to the method, dropping `dry_run` / `assignments[]` (sync_creatives) and `dry_run` (sync_accounts). The legacy `/mcp` route saw them; `/sales/mcp`, `/creative/mcp`, `/creative-builder/mcp`, and every per-tenant `accounts.upsert` silently ignored them. 7.8 fixed this upstream by exposing the original envelope as `ctx.input: Readonly<Record<string, unknown>>` (adcp-client#1842) — this change adopts it. - `v6-input-helpers.ts` adds `pickFromInput` for named-field lifts. Per SDK guidance, `ctx.input` is buyer-controlled and untrusted; the helper reads only named fields, never logs wholesale. - `syncCreatives` in the 3 creative-bearing v6 platforms now threads `dry_run` (suppresses session persistence in `handleSyncCreatives`) and `assignments[]` (writes inline package bindings to session). The v6 response signature is `SyncCreativesRow[]`, so assignment results surface via subsequent `get_media_buys`, not the sync response itself. - `syncAccountsUpsert` in `v6-account-helpers.ts` threads `dry_run` to `handleSyncAccounts`. `delete_missing` is on the SDK's drop list but v5 doesn't implement it yet — threading would be inert. Tests: 5 picker tests in `v6-input-helpers.test.ts` cover the lift shape (named fields, no undefined leakage, falsy preservation, undefined input, no-match). Storyboard matrix held identical numbers (no storyboard currently exercises `dry_run` or inline `assignments[]` on these paths, so the threading is dormant infrastructure until an adopter or future storyboard reaches for it). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * feat(scripts): exercise AAO directory inverse-lookup in e2e Extends `e2e-resolve-training-agent.ts` to call `fetchAgentAuthorizationsFromDirectory` (shipped in @adcp/[email protected]) after the existing 8-step forward chain, printing publishers whose adagents.json authorizes the resolved agent. Pairs the SDK consumer wrapper with PR #4836's server endpoint for a runnable demo of the full directory chain. - HTTP mode: directory URL defaults to `${base-url}/api` (registry router mount point per `server/src/http.ts:1072`). Override with `--directory <url>` or skip with `--directory none`. - In-process mode: skipped — the inline Express app doesn't mount the AAO routes (federated_index pool unavailable in script context). - Directory failures don't fail the script; the forward chain is the primary contract. The SDK's `ssrfSafeFetch` permits loopback by default (`probe-policy.d.ts` table — loopback is allowed for buyer-side discovery), so `http://localhost:3000` works out of the box. The endpoint's published path is `/v1/agents/{encoded_agent_url}/publishers` per spec; our deployment mounts the registry router under `/api`, hence the `${base}/api` default. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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
AGENT_SUSPENDED(recoverable via re-onboarding) andAGENT_BLOCKED(permanent denial). Bothrecovery: terminal. Sibling toACCOUNT_SUSPENDED/CAMPAIGN_SUSPENDED. The code itself is the discriminator — noerror.detailspayload, mirroringBILLING_NOT_PERMITTED_FOR_AGENT.details.statusplaceholder. 3.0.5 shippederror-details/agent-permission-denied.jsonwith adetails.status: ["suspended", "blocked"]axis as a placeholder while these dedicated codes were being designed. 3.1 removes the placeholder; the schema now carries onlyscope: "agent"+reason: "sandbox_only"for non-status per-agent provisioning gates.oneOfexclusivity drops out (single payload axis),reasonbecomes required.AGENT_SUSPENDED/AGENT_BLOCKED/PERMISSION_DENIED + scope:"agent" + reason:"sandbox_only").Closes #3871. Builds on (and partially reshapes) #3887.
Why this lands as
minor(3.1.0), notpatch(3.0.6)The changeset queue already accumulated ~30
minorentries (RBAC errors, billing-gate conformance, AAO Verified, completion-source qualifier, etc.).npx changeset statusconfirms the next cut is 3.1.0 regardless. Curating a 3.0.6 patch would require cherry-picking around the queue — more friction than value.Given the next release is 3.1.0 anyway, the deprecation pattern (keep
statusannotateddeprecated: true, plumb dual-pathway dispatch through 3.1 → 3.2) was over-engineered for a field that's been in the wild for 12 hours with one Phase-1-placeholder adopter (adcp-client#1269). Cleaner: consolidate the placeholder in the same release that introduces the dedicated codes, document the migration in release notes.Migration
Sellers that integrated against the 3.0.5 placeholder shape:
code: PERMISSION_DENIED, details: { scope: "agent", status: "suspended" }code: AGENT_SUSPENDED(nodetails)code: PERMISSION_DENIED, details: { scope: "agent", status: "blocked" }code: AGENT_BLOCKED(nodetails)code: PERMISSION_DENIED, details: { scope: "agent", reason: "sandbox_only" }Schema-validation flips from accepting
statusenvelopes to rejecting them — sellers MUST switch to dedicated codes. The migration note is inerror-handling.mdxPer-Agent Authorization Gate.DX-expert gap from #3887 review — closed
The DX-expert flagged that #3887's
enumMetadata.recoveryforPERMISSION_DENIEDis flatcorrectablewhile the prose said suspended/blocked are terminal-pending-onboarding. With dedicatedAGENT_SUSPENDED/AGENT_BLOCKEDcodes carryingrecovery: "terminal"directly at the wire level, the contradiction narrows to just thesandbox_onlyedge case (where the agent can't fix it autonomously either way; documented in the dispatch example).Cross-tenant clamp (unchanged from #3887)
AGENT_SUSPENDED/AGENT_BLOCKEDorPERMISSION_DENIED + scope:"agent"only when buyer-agent identity has been established (signed-request derivation OR credential-to-agent mapping).PERMISSION_DENIEDand omiterror.details.scope.Files
static/schemas/source/enums/error-code.json—AGENT_SUSPENDED/AGENT_BLOCKEDenum + descriptions +enumMetadata.recovery: "terminal".PERMISSION_DENIEDdescription updated to point at new codes for the suspended/blocked states.static/schemas/source/error-details/agent-permission-denied.json—statusfield removed,oneOfremoved,reasonrequired. Description rewritten to reflect non-status-only payload.docs/building/implementation/error-handling.mdx— Authorization (RBAC) table addsAGENT_SUSPENDED/AGENT_BLOCKEDrows. Per-Agent Authorization Gate subsection rewritten to cover all three paths under a single uniform clamp + composition-pattern guidance + 3.0.5 → 3.1 migration note.Composition guidance (added)
New paragraph names the rule: lifecycle-terminal per-agent states get dedicated codes; throttling-shaped rejections reuse
RATE_LIMITED; non-status provisioning gates extend thereasonenum. Without this, code 13 was going to beAGENT_THROTTLED.Test plan
node scripts/lint-error-codes.cjs— clean (3 pre-existing storyboard errors onBRAND_NOT_FOUNDare unrelated).npm run build:schemas— regenerates dist; new codes bundle cleanly.npm run typecheck— clean.sandbox_only→ accept ✓🤖 Generated with Claude Code