Skip to content

fix(adagents): inline-resolution path for publisher_properties selectors + publisher_domains[] fan-out#750

Draft
bokelley wants to merge 4 commits into
mainfrom
claude/issue-749-publisher-properties-inline-resolution
Draft

fix(adagents): inline-resolution path for publisher_properties selectors + publisher_domains[] fan-out#750
bokelley wants to merge 4 commits into
mainfrom
claude/issue-749-publisher-properties-inline-resolution

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Refs #749

Fixes the two bugs in _resolve_agent_properties for the publisher_properties authorization type (Part 1 of #749):

  1. Wrong return value — the function was returning raw selector dicts (objects with publisher_domain, selection_type, property_tags, etc.) instead of the resolved property objects those selectors describe. get_properties_by_agent(cafemedia_data, "https://interchange.io") now returns the inline properties rather than 1 selector dict.

  2. No publisher_domains[] fan-out — the compact publisher_domains[] array form from adcp#4825/4827 wasn't expanded into per-domain resolution. _selector_domains() now handles both the scalar publisher_domain field and the compact array form.

New helpers:

  • _selector_domains(selector) — extracts domain(s) from either scalar or array form
  • _resolve_inline(selector, parent_properties, domain) — attempts inline resolution from the parent file's top-level properties[]; returns None when no inline data exists for the domain (federated fallback hook-point), [] when inline data exists but nothing matches the selector filter (real empty; no fallback)

Deferred from #749:

What was tested

  • ruff check src/adcp/adagents.py tests/test_adagents.py — clean
  • mypy src/adcp/adagents.py — clean (0 errors)
  • pytest tests/test_adagents.py — 125 passed, 0 failed
  • Existing test_get_properties_by_agent_publisher_properties rewritten to assert resolved property objects (previously encoded the buggy selector-passthrough behavior)
  • New: test_get_properties_by_agent_publisher_domains_fanoutpublisher_domains[] compact form fans out correctly
  • New: test_get_properties_by_agent_publisher_properties_no_inline — empty properties[] returns []
  • New: test_get_properties_by_agent_publisher_properties_by_idselection_type: "by_id" filters correctly

Pre-PR review

  • code-reviewer: approved — fixed by_id str filter, multi-selector deduplication, and missing by_id unit test per blocker findings; one nit surfaced (empty by_tag passthrough is permissive; acceptable given schema minItems: 1 upstream)
  • ad-tech-protocol-expert: approved for Part 1 inline path; publisher_domains[] schema gap noted (schema cache needs updating from adcp#4827 — tracked separately); None docstring reworded to avoid forward-declared MUST obligation

Nits (not fixed):

  • by_tag with empty property_tags returns all domain candidates (permissive); schema enforces minItems: 1 upstream so this path is unreachable on valid input
  • _selector_domains silently ignores non-list publisher_domains values (intentional defensive drop)

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}


Generated by Claude Code

claude added 2 commits May 20, 2026 12:50
…ors + publisher_domains[] fan-out

Fixes the bug where _resolve_agent_properties with authorization_type
"publisher_properties" returned raw selector dicts instead of resolved
property objects. Implements the inline-resolution path from adcp#4827:
for each selector, fan out over publisher_domain / publisher_domains[],
match against the parent file's top-level properties[] by publisher_domain,
apply selection_type filter (all / by_tag / by_id), and extend the result.

Also adds _selector_domains() and _resolve_inline() as internal helpers
with the None-vs-[] sentinel contract documented in their docstrings.
Federated fetch (HTTP per-domain fallback) is deferred per #749.

Refs #749
…e docstring

- Deduplicate by property_id across multi-selector/multi-domain fan-out so
  a property appearing in two selectors isn't returned twice
- Filter by_id property_ids to str members (matches the by_tag pattern)
- Reword _resolve_inline docstring: None means no inline data for the domain
  (federated not yet implemented), not a MUST-federate contract
- Add by_id selection_type unit test

Refs #749
claude added 2 commits May 20, 2026 14:30
…femedia scale

Pre-builds a domain→properties index in _resolve_agent_properties before
the selector loop so each per-domain inline lookup is O(1) rather than
O(N). At cafemedia scale (6,843 properties × 6,800 domains) the
unindexed path was ~46 M comparisons; with the index it is O(N+M).

Also adds the cafemedia/interchange.io canonical fixture (6,843
properties, publisher_domains[] compact form) to the test suite —
sized to expose O(N×M) regressions and validate the raptive_managed
tag filter against the production managed-network shape.

Part of #749.

https://claude.ai/code/session_01RDYrywLhVbd4crrAHkTnsH
Reviewer noted the subset assertion (<=) would pass even if half the
domains were missing. Changed to equality so all 6,800 child domains
must appear in the resolved result.

Part of #749.

https://claude.ai/code/session_01RDYrywLhVbd4crrAHkTnsH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants