Skip to content

Commit 33525ce

Browse files
committed
feat(adagents): directory inverse-lookup + divergence detector (Parts 2+3 of #749)
Squashed onto main to resolve conflicts with #753 (publisher_domains compact form, revoked_publisher_domains) and main HEAD. Final state of this PR: - fetch_agent_authorizations_from_directory: async wrapper for GET /v1/agents/ {agent_url}/publishers (per adcp#4823 / adcp#4828). Returns AgentDirectoryLookup with spec-conformant envelope (agent_url, directory_indexed_at, publishers, next_cursor). Accepts include=["properties"] to request per-publisher property_ids[] (per adcp#4894). - detect_publisher_properties_divergence: full (publisher_domain, property_id) set-diff when directory returns property_ids[]; falls back to count-only comparison against directories that haven't deployed adcp#4894 yet. max_concurrency=20 default semaphore caps concurrent fetches at managed- network scale. sample_size=200 default opt-in for full sweep. - AgentPublisherEntry / AgentDirectoryLookup / PublisherDivergence / DivergenceReport dataclasses; DiscoveryMethod / PublisherStatus Literal enums. - AAO_PUBLISHER_DIRECTORY_URL env var supported (matches salesagent convention). - Tests use respx.mock against spec-shaped JSON payloads. Closes #749 Parts 2 and 3. Companion to #750 (Part 1: inline-resolution).
1 parent 7545424 commit 33525ce

4 files changed

Lines changed: 1317 additions & 3 deletions

File tree

src/adcp/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@
1616
AdagentsFetchResult,
1717
AdagentsValidationReport,
1818
AdAgentsValidationResult,
19+
AgentDirectoryLookup,
20+
AgentPublisherEntry,
1921
AuthorizationContext,
2022
DiscoveryMethod,
23+
DivergenceReport,
2124
EntryErrorKind,
25+
PublisherDivergence,
26+
PublisherStatus,
27+
detect_publisher_properties_divergence,
2228
domain_matches,
2329
fetch_adagents,
2430
fetch_adagents_with_cache,
2531
fetch_agent_authorizations,
32+
fetch_agent_authorizations_from_directory,
2633
filter_revoked_selectors,
2734
get_all_properties,
2835
get_all_tags,
@@ -821,13 +828,20 @@ def get_adcp_version() -> str:
821828
"AdagentsEntryError",
822829
"AdagentsFetchResult",
823830
"AdagentsValidationReport",
831+
"AgentDirectoryLookup",
832+
"AgentPublisherEntry",
824833
"AuthorizationContext",
834+
"detect_publisher_properties_divergence",
825835
"DiscoveryMethod",
836+
"DivergenceReport",
826837
"EntryErrorKind",
827838
"fetch_adagents",
828839
"fetch_adagents_with_cache",
829840
"fetch_agent_authorizations",
841+
"fetch_agent_authorizations_from_directory",
830842
"filter_revoked_selectors",
843+
"PublisherDivergence",
844+
"PublisherStatus",
831845
"validate_adagents_domain",
832846
"validate_adagents_structure",
833847
"verify_agent_authorization",

0 commit comments

Comments
 (0)