Skip to content

feat: audience governance schemas + match breakdown#380

Merged
bokelley merged 5 commits into
mainfrom
bokelley/adcp-1593-audience-gov
Mar 23, 2026
Merged

feat: audience governance schemas + match breakdown#380
bokelley merged 5 commits into
mainfrom
bokelley/adcp-1593-audience-gov

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Sync schemas from AdCP PR fix(agent-client): narrow pendingTaskId auto-thread to same-skill same-context (#1590) #1593: audience-selector, audience-constraints, restricted-attribute, match-id-type
  • Adapt to breaking upstream changes: buyer_ref removed from media buy, buyer_campaign_ref removed from governance, governance_context now opaque string
  • Register sync_audiences in TOOL_RESPONSE_SCHEMAS for runtime validation
  • Add campaign governance scenarios to comply() governance track
  • Comprehensive Zod, response, and governance unit tests

Breaking upstream schema changes handled

Field Change Impact
buyer_ref Removed from create_media_buy/update_media_buy Tests and fixtures updated
buyer_campaign_ref Removed from check_governance/report_plan_outcome Middleware, adapter, scenarios updated
governance_context Structured object → opaque string parseCheckResponse captures token, reportOutcome threads it through. Skips outcome reporting when absent.
policy-entry.verticals Renamed to policy_categories Schema sync handles this
brand.industry Renamed to brand.industries (string → string[]) Schema sync handles this

Compliance testing additions

  • sync_plans: sends policy_categories, audience constraints (include/exclude), restricted_attributes, min_audience_size
  • check_governance: captures and previews governance_context round-trip
  • delivery monitoring: sends audience_distribution with baseline/indices/cumulative_indices, including skewed drift scenario
  • sync_audiences: reports match_breakdown, effective_match_rate in response preview
  • signals flow: advisory step checking for restricted_attributes/policy_categories on signal definitions

Test plan

  • npm run build passes (clean TypeScript compilation)
  • All 1299 tests pass, 0 failures
  • New Zod schema tests validate all audience governance types (AudienceSelector, AudienceConstraints, RestrictedAttribute, MatchIDType)
  • Response validation tests for sync_audiences match breakdown
  • Governance unit tests for governance_context round-trip
  • Code review: all Must Fix items addressed
  • Security review: no Must Fix items, Should Fix (empty string fallback) addressed

🤖 Generated with Claude Code

bokelley and others added 5 commits March 23, 2026 12:02
…sting

Sync schemas from AdCP PR #1593. Adds audience-selector (discriminated
union), audience-constraints, restricted-attribute (GDPR Article 9 enum),
and match-id-type schemas.

Adapts to breaking upstream changes: buyer_ref removed from
create/update_media_buy, buyer_campaign_ref removed from governance
requests, governance_context changed from structured object to opaque
string token.

Updates GovernanceMiddleware, GovernanceAdapter, and TaskExecutor to
thread governance_context through the check -> report lifecycle. Skips
outcome reporting when governance agent does not issue a context token.

Registers sync_audiences in TOOL_RESPONSE_SCHEMAS. Adds campaign
governance scenarios to comply() governance track with audience
constraints, policy_categories, restricted_attributes, and
audience_distribution. Signals flow reports governance metadata
availability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Force-refresh media-buy schemas to pick up buyer_ref removal, context
field additions, and PackageUpdate restructuring from upstream.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bokelley bokelley requested a review from EmmaLouise2018 March 23, 2026 09:40
@bokelley bokelley merged commit 656e5f2 into main Mar 23, 2026
10 checks passed
bokelley added a commit that referenced this pull request Mar 23, 2026
Regenerate types, keep governanceContext optional for backward compat.

Co-Authored-By: Claude Opus 4.6 (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.

2 participants