Skip to content

feat(training-agent): declare and honour property_list targeting - #8078

Merged
bokelley merged 1 commit into
mainfrom
conductor/33-pull-7911-training-test-agent-declare-and-hon
Oct 9, 2026
Merged

bokelley merged 1 commit into
mainfrom
conductor/33-pull-7911-training-test-agent-declare-and-hon

Conversation

@bokelley

@bokelley bokelley commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Refs #7911

What

The training agent becomes a reference seller for buyer property-list targeting: it declares the capability, fetches the buyer's list, and applies it, so a buyer can test a PropertyListReference end to end.

  • Declaration. media_buy.execution.targeting.property_list and property_list_exclude are true (current and 3.2 surfaces; not on the frozen 3.0-compat response, whose schema predates the flags). Product.overlay_support.property_list_exclude is set on every catalog product. overlay_support.property_list plus property_targeting_allowed: true is set only on Meridian's multi-property products, so inclusion is offered only where a buyer can subdivide the inventory.
  • SSRF. validateListRef rejects a private, loopback or internal agent_url, userinfo, query and fragment for property lists, before any fetch. This deployment's own governance tenant is allowed and is read in process, with no network call.
  • Fetch. MCP get_property_list through the existing safeFetch pattern (no redirects, DNS-pinned). auth_token is sent as Bearer only when present, and is never logged or echoed (targetingForWire still strips it). Snapshots are cached per session, keyed (agent_url, list_id, credential fingerprint), until cache_valid_until (clamped to 1h). The fingerprint is an addition to the brief's key, so a credentialed fetch is never served to an anonymous caller. Page, identifier-count, identifier-length and wall-clock bounds apply.
  • Apply (create, update, new_packages).
    • Include: product properties ∩ list must be non-empty.
    • Exclude: removes the listed properties and rejects if none remain; exclude wins on overlap.
    • An unfetchable list rejects the whole request. Update resolves lists before mutating the detached copy, so it stays atomic.
    • property_targeting_allowed: false rejects include and still applies exclude.
  • Surfaced. The effective property set and one inventory-list-application-shaped receipt per list are on the package as ext.training_agent.{effective_properties,list_applications}. The Package schema has no first-class field for either, and targeting_resolution requires demographics, so ext was the schema-fitting home.
  • Error codes (all existing). Empty intersection or exclusion → PRODUCT_UNAVAILABLE. Include on a product that doesn't allow it, or exclude on one that doesn't declare it → UNSUPPORTED_FEATURE. List not found or denied → REFERENCE_NOT_FOUND. List agent unreachable, failing or malformed → SERVICE_UNAVAILABLE (transient). Private URL → VALIDATION_ERROR. The spec assigns no list-fetch-specific code; these follow the existing UNSUPPORTED_FEATURE / PRODUCT_UNAVAILABLE / REFERENCE_NOT_FOUND conventions.

Storyboards now running against /sales

Declaring the capability turns on media_buy_seller/inventory_list_targeting and inventory_list_no_match, which reference lists on a fictional governance.pinnacle-agency.example agent ("the seller's test engine resolves them"). So:

  • property-list-fixtures.ts resolves exactly the three acme_outdoor_* property lists from the test kit in process; a unit test pins them to inventory_targets in acme-outdoor.yaml.
  • Meridian gains four outdoor-lifestyle digital properties (the kit's domains) so the matching lists intersect real inventory.
  • Meridian's CPM option (min $5k) is now listed before its flat-rate option (min $15k). Without that, inventory_list_no_match (budget $10k) fails the minimum-spend check before reaching the list. This also changes Meridian's primaryPricing.

Tests

  • New training-agent-property-list-targeting.test.ts (29): SSRF reject with zero fetches, a real MCP list-agent stub (Bearer present/absent, cache hit, expiry refetch), include intersection, exclude, exclude emptying the package, overlap, property_targeting_allowed: false, fetch failure rejecting create and update (buy untouched), the in-process governance tenant, fixture/test-kit parity.
  • Two existing persistence tests in training-agent.test.ts sent property_list to a product that doesn't allow it; they now use collection_list.
  • npm run typecheck clean; npm run test:server-unit 12,296 pass. The precommit hook ran green.
  • Storyboards, current surface: the local matrix passed every tenant, and /sales ran as all 8 isolated shards at 168/168 clean, 1,162 passed steps (floor 646). inventory_list_targeting 6/6, inventory_list_no_match 4/4, targeting_aware_discovery 34/34.
  • The pre-push hook's 3.0-compat storyboard pass takes over an hour in this sandbox. I pushed with ADCP_SKIP_STORYBOARD_MATRIX=1 (documented in .husky/pre-push, CI authoritative). It was clean through /signals and was on /sales when I stopped it. The 3.0-compat surface does not see the new flags, so CI should grade it unchanged.

Reviews

Security and code review agents ran. Fixed: cache and size bounds, cache-key ambiguity, URL logging, SSRF scoped to dialed (property) lists, seeded products that declare support but have non-enumerable inventory, ext merge consistency. Not done: per-request memoisation of uncached lists, restricting list-agent ports, stripping auth_token from persisted package state.

Follow-ups (not this PR)

Storyboard "seller fetches and applies a buyer property list"; get_products property-list application and list_applications receipts.

🤖 Generated with Claude Code


Open workspace in Conductor

…t_exclude targeting

The training agent now fetches buyer property lists from the referenced list
agent (SSRF-guarded, Bearer only when a token is supplied, cached per session
until cache_valid_until), applies include/exclude to the product's properties
on create and update, and rejects the whole request when a list cannot be
fetched or leaves no eligible inventory. Declares both capability flags and
Product.overlay_support, and resolves the acme-outdoor test-kit lists so the
inventory_list_* storyboards run.

Refs #7911

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@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 — server-only training-agent reference seller for buyer property-list targeting; no blocking findings.

What I checked

  • Scope: server-only (server/src/training-agent/** + tests). No static/schemas/source/**, docs/reference/**, dist/**, or migrations touched — so no changeset is required (a changeset here would be out of scope).
  • Wire fidelity: get_property_list request (list_id/resolve/pagination.max_results/cursor) and response reading (identifiers/pagination.has_more/resolved_at/cache_valid_until) match the schemas; identifierMatches honors documented domain semantics (base+www+m, *. = subdomains only).
  • Safety: SSRF guard fails closed before any fetch (private/loopback/userinfo/query/fragment rejected); cache-expiry clamp bounds to a 1h snapshot with unparseable values falling to epoch; resolution bounded (5s/page, 15s wall-clock, 5k identifiers, 5 pages); timeouts/cancellation present on the MCP fetch path; update resolves before mutating a detached copy (atomic reject on bad list); account scoped to caller — no cross-account read.

Medium findings (1 — non-blocking)

  • server/src/training-agent/property-list-targeting.ts:334 — Buyer auth_token now live and persisted unencrypted in session state at rest (stripped on the wire). Worth vaulting as a follow-up.

Decision: 1 medium finding, no critical/high, no gated paths, high_risk false, no team gate. Rows 1–8 do not fire (row 8 requires ≥3 medium); falls through to row 9 → approve.

Medium findings

  • server/src/training-agent/property-list-targeting.ts:334 — Buyer auth_token now live-but persisted in session state at rest

@bokelley
bokelley merged commit d21fb01 into main Oct 9, 2026
55 checks passed
@bokelley
bokelley deleted the conductor/33-pull-7911-training-test-agent-declare-and-hon branch October 9, 2026 08:22
bokelley added a commit that referenced this pull request Oct 9, 2026
Add impressions-optional delivery rows (#8108) to the versioning
exceptions and migration guide, expected_confirmation_at on
refine_proposals (#8104), SDK implementation metadata (#8079),
unsupported-targeting-dimension details (#8052), experimental trust.json
schemas (#8067), the Reliable Reporting compaction notice and
REVISION_UNREADABLE (#8100, #8099), the sales-broadcast-tv 1.1.0
tightening (#8046), new signing and canonicalization vectors (#8068,
#8076), and training-agent fixtures (#8106, #8078, #8012). Regenerate
the In-review table from the 56 open 3.3.0 milestone issues.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant