Skip to content

fix(training-agent): uniform not-found on property-list handlers (#2739)#2745

Merged
bokelley merged 1 commit into
mainfrom
bokelley/issue-2739
Apr 21, 2026
Merged

fix(training-agent): uniform not-found on property-list handlers (#2739)#2745
bokelley merged 1 commit into
mainfrom
bokelley/issue-2739

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

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, and task-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:1222 in 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 --noEmit clean
  • Full pre-commit suite (631 tests + typecheck) green
  • After merge: re-run npx @adcp/client fuzz https://test-agent.adcontextprotocol.org/mcp/ --tools get_property_list --turn-budget 1 against the deployed training agent and confirm the uniform-error invariant flips from FAIL to PASS

🤖 Generated with Claude Code

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>
@bokelley bokelley merged commit 48ceecb into main Apr 21, 2026
14 checks passed
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.

test agent: get_property_list error.message echoes probed id (uniform-response MUST)

1 participant