fix(training-agent): uniform not-found on property-list handlers (#2739)#2745
Merged
Conversation
Get/update/delete/validate_property_delivery were returning `{ code: 'not_found',
message: "No property list with id '<id>'" }`, echoing the probed list_id into
the error body. Two paired probes with distinct unresolvable ids produced
distinguishable responses — a cross-tenant enumeration oracle the AdCP 3.0
uniform-error-response MUST forbids.
Now returns `{ code: 'REFERENCE_NOT_FOUND', message: 'Property list not found',
field: 'list_id' }`, byte-identical across probes. REFERENCE_NOT_FOUND is the
spec's canonical fallback for property lists (error-code.json enum description
names property lists explicitly); error.field is the caller-supplied parameter
name, not a resolved type.
Adds paired-probe tests for all four handlers to lock the invariant.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
get_property_list,update_property_list,delete_property_list, andvalidate_property_deliveryin the training agent were returning{ code: 'not_found', message: "No property list with id '<id>'" }on unresolvedlist_id— echoing the probed id into the error body made "exists but inaccessible" and "does not exist" distinguishable via two paired probes, a direct violation of the AdCP 3.0 uniform-error-response MUST (closes test agent: get_property_list error.message echoes probed id (uniform-response MUST) #2739).{ code: 'REFERENCE_NOT_FOUND', message: 'Property list not found', field: 'list_id' }— byte-identical across probes.REFERENCE_NOT_FOUNDis the spec's canonical fallback for property lists pererror-code.json.error.fieldnames the caller-supplied parameter (not a resolved type), which is allowed for type-neutral parameter names pererror-handling.mdx.@adcp/clientfuzz check (Fuzz invariant: byte-equivalent error responses for unauthorized vs unknown references adcp-client#731, feat: add shareable links for Addie threads in admin #737) stays green against the public test agent.Scope
Limited to
property-handlers.ts. Security review inventoried the same bug pattern in adjacent files —content-standards-handlers.ts(4 sites),governance-handlers.ts:1135,brand-handlers.ts(4 sites),inventory-governance-handlers.ts(2 sites),catalog-event-handlers.ts:496, andtask-handlers.ts— each needs a per-resource judgement (REFERENCE_NOT_FOUND vs resource-specific codes like PLAN_NOT_FOUND that were retained in the collapse). Filing a follow-up issue rather than bundling, per code-reviewer guidance.brand-handlers.ts:1222in particular leaks a state-transition hint via the recovery message ("Acquire rights first using acquire_rights") that distinguishes "never existed" from "expired/consumed" even if the id is stripped — call out in the follow-up.Test plan
npx vitest run tests/unit/training-agent.test.ts— 338/338 passing (334 existing + 4 new paired-probe)tsc --noEmitcleannpx @adcp/client fuzz https://test-agent.adcontextprotocol.org/mcp/ --tools get_property_list --turn-budget 1against the deployed training agent and confirm the uniform-error invariant flips from FAIL to PASS🤖 Generated with Claude Code