Skip to content

feat(server): project publisher_properties fan-out into catalog so /registry/authorizations sync consumers see managed-network children #4841

Closed

Description

@bokelley

Follow-up to #4839 / PR #4840 — the crawler now writes per-child rows to the legacy agent_publisher_authorizations table for publisher_properties[].publisher_domains[] fan-outs (managed-network shape, e.g. cafemedia's 6,800 represented publishers). Catalog-only consumers don't see them.

The gap

The federated-index reader (getDomainsForAgent, getPublishersForAgentDetail) unions both arms:

FROM agent_publisher_authorizations      -- legacy arm (fan-out lands here)
UNION ALL
SELECT ... FROM v_effective_agent_authorizations  -- catalog arm

So the directory endpoint (/v1/agents/{agent_url}/publishers) and most read endpoints see the 6,800 child rows.

But the partner sync endpoints read only from the catalog:

  • GET /registry/authorizations?agent_url=... (registry-api.ts:7592) — authSnapshotDb.getNarrow queries v_effective_agent_authorizations
  • GET /registry/authorizations/snapshot (registry-api.ts:7642) — same backing source

Catalog-only consumers (DSPs syncing the full authorization graph for sales-agent routing) get cafemedia.com as a single row with no children. That's exactly the wrong answer at managed-network scale.

Why this matters

The /registry/authorizations/snapshot endpoint is the partner sync surface — the one a downstream platform uses to ingest the entire (agent_url, publisher_domain) graph and join it against their bid stream. Without fan-out projection, those platforms miss 6,800 of the 6,801 represented publishers for any managed network they ingest.

Options

A. Crawler writes to both arms (parallel write).
Extend recordAgentFromAdagentsJson (the call site for fan-out at crawler.ts:1054) to also project a row into catalog_agent_authorizations with evidence='adagents_json', created_by='system:fanout' so the catalog view picks it up. Cleanest semantically — fan-out is canonical, both arms reflect it.

B. Catalog view consumes legacy fan-out rows.
Amend v_effective_agent_authorizations (or the writer that produces it) to UNION-include legacy agent_publisher_authorizations rows whose source='adagents_json' and whose publisher_domain has a publishers row with discovery_method='adagents_authoritative'. Less invasive — no new writes — but couples the catalog view to a legacy-table fact.

C. Defer until the #3177 catalog cutover lands.
The catalog migration is in progress (the dual-read pattern in getDomainsForAgent mentions "after PR 5 the legacy arm is removed"). If the cutover plan already accounts for fan-out rows, this might resolve itself. Worth a check with whoever owns #3177 before committing to A or B.

Recommendation: C first, then A if the cutover doesn't address it. Don't double-write or couple the view if the cutover work is already going to subsume this.

Acceptance

  • Decision recorded: which option (or confirmation that Unify property registry: retire discovered_properties, single source of truth in catalog #3177 catalog cutover covers it)
  • If A or B: catalog query for agent_url=https://interchange.io returns ~6,800 rows after the next cafemedia crawl
  • /registry/authorizations/snapshot ndjson stream includes the 6,800 children
  • Integration test asserting parity between getDomainsForAgent (read-side, sees both) and authSnapshotDb (catalog-only) on a managed-network fixture

References

Activity

  1. added
    enhancement
    claude-triaging
    on May 20, 2026
  2. bokelley commented on May 20, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Bug (catalog-only sync surface returns wrong count — missing 6,800 fan-out rows)
    Bucket(s): registry / discovery (no registry label in repo — noted in run summary)
    Status: deferred

    Blocked-on: #4840 — resurfaces on merge

    Note: #3177 (catalog cutover) closed as completed on 2026-05-17, so Option C is resolved. #3177's cutover plan explicitly included retiring agent_publisher_authorizations, which means catalog_agent_authorizations should now exist. Option A (extend fanOutPublisherPropertiesAuthorizations to also project into catalog_agent_authorizations with evidence='adagents_json') is the natural fold into #4840 before that PR merges — the catalog table is the write target the cutover established.


    Triaged by Claude Code. Session: https://claude.ai/code/cse_01Mq1uXQswA3Zo6ptaPGKsEN


    Generated by Claude Code

  3. added
    claude-triaged
    and removed
    claude-triaging
    on May 20, 2026
  4. bokelley commented on May 20, 2026

    @bokelley
    ContributorAuthor

    Investigation update — defer impl, file follow-up after design call

    Looked at this in detail; the implementation is more involved than the "Option A vs B vs C" framing suggested. Here's what I found.

    #3177 cutover state

    #3177 is closed; the writer cutover (step 2) landed and publisher-db.ts:upsertAdagentsCache projects catalog_agent_authorizations rows in parallel with the legacy agent_publisher_authorizations write. So Option C ("wait for #3177") is not the answer — the cutover happened before fan-out existed, and the projection has a deliberate guard against the exact shape fan-out introduces.

    The guard

    publisher-db.ts:968-982 in upsertAdagentsCache:

    ```
    if (selPubSingular !== publisherDomain && !selPubInList) {
    // Cross-publisher third-party-sales claim. Refused per spec — the
    // writer cannot land an authoritative row for another publisher's
    // properties without out-of-band corroboration.
    log.warn({ ... }, 'Skipping auth projection: publisher_properties claims a different publisher (cross-publisher refused)');
    continue;
    }
    ```

    When cafemedia.com is the publisher being projected, the selector lists 6,800 child publisher_domains. None equal "cafemedia.com" — so the guard refuses to project. In production logs I confirmed:

    ```
    {"publisherDomain":"cafemedia.com","agentUrl":"https://interchange.io","selPub":null,"selPubsCount":6800,"msg":"Skipping auth projection: publisher_properties claims a different publisher (cross-publisher refused)"}
    ```

    This guard is load-bearing for catalog trust — it's what prevents a hostile manager file from projecting catalog_agent_authorizations rows for publishers that didn't authorize anything. It can't simply be lifted.

    What Option A (parallel writes from fan-out) would actually require

    1. New evidence value on catalog_agent_authorizations (migration 440's CHECK is currently { adagents_json, agent_claim, community }). Add adagents_authoritative (or manager_asserted) with documented lower trust than adagents_json.
    2. Lift the cross-publisher guard only for the fan-out shape — selectors with publisher_domains[] AND the parent file's properties[] carrying matching publisher_domain (the inline-resolution rule from feat(adagents): clarify publisher_properties resolution — managed-network pattern needs inlined-properties path #4825). Pure publisher_properties without inline anchoring stays refused.
    3. Write per-child catalog rows from the fan-out path (recordChildPublisherFromManager) with the new evidence value. Each row asserts "the manager file at `manager_domain` claims agent X is authorized for publisher Y".
    4. Update v_effective_agent_authorizations if needed so consumers see the new evidence value through the effective view.
    5. Backfill — ~6,800 cafemedia children currently live only in the legacy arm; one-shot SQL inserts them into catalog with the new evidence value.

    What Option B (catalog view consumes legacy fan-out rows) would actually require

    Less invasive but more coupling. Amend v_effective_agent_authorizations to UNION in legacy agent_publisher_authorizations rows whose publisher has discovery_method='adagents_authoritative'. No new writes, no schema change. But: now the catalog view depends on a legacy-table fact for correctness, which makes the eventual "drop old tables" step (step 5 of #3177) more dangerous.

    Recommendation

    Defer until a design call decides the evidence-model question. The two open sub-questions are:

    1. Does adagents_authoritative deserve a distinct evidence value, or is it "weak adagents_json"? Spec PR feat(adagents): endorse parent-file inline resolution of publisher_properties (#4825) #4827 carries the "low-medium trust" framing — that argues for a distinct value so consumers can filter. The cost is wider CHECK + adapter logic in callers reading evidence.

    2. What's the acceptance threshold for cross-publisher projection? Today: exact match. Proposed: exact match OR (selector lists this publisher AND parent file inlines a property with matching publisher_domain). The second condition is the inline-resolution rule's structural check; codifying it in the writer is the load-bearing trust change.

    Both questions are spec/security adjacent. Filing as a tracked follow-up rather than landing impl unilaterally.

    Operational impact in the meantime

    /registry/authorizations/snapshot consumers (DSPs syncing the full authorization graph) miss the ~6,800 cafemedia children today. This is real but currently nobody-actively-suffering — the directory inverse-lookup (#4823) which IS consumer-facing uses the UNION of both arms and sees the fan-out rows correctly.

    The /registry/authorizations (single-agent) endpoint also returns the auth-snapshot view, so the same gap applies there.

    Proposed next step

    Open a small design doc in docs/internals/ (or as a tracked sub-issue) covering the two open questions above. Once that lands, the impl is straightforward — a single migration to widen the CHECK + a 50-ish line writer change in publisher-db.ts + a backfill query. Filed as not-blocking-this-quarter unless a partner explicitly asks.


    Closing this comment by tagging the related landed work for context:

  5. added
    claude-triaging
    on May 20, 2026
  6. bokelley commented on May 20, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Bug (catalog sync gap — 6,800 managed-network children missing from /registry/authorizations snapshot surface)
    Bucket(s): registry / discovery
    Status: ready-for-human

    What the experts said:

    • ad-tech-protocol-expert: Q2 (guard relaxation / cross-publisher corroboration) is a normative spec change — must be codified in adagents.json spec and reviewed by WG before the guard can be relaxed. Q1 (evidence enum) is a minor changeset; no RFC. IAB sellers.json §4.3 is direct prior art for the corroboration model.
    • adtech-product-expert: Gap is real but not causing live routing harm today (no DSP confirmed using snapshot endpoint for active routing). Option B is lower-risk than assessed: the same UNION pattern is already live in federated-index-db.ts:195-232 for directory endpoints — the coupling you flagged exists there already. Recommends UNION patch in the snapshot query as a near-term close (no guard change, no evidence-tier decision, no spec PR). Full Option A deferred to 3.1.x.

    My take: @bokelley, the experts diverge from your Option B coupling concern — that coupling is already present in the directory arm. The decision is whether to extend the existing UNION precedent to the snapshot path now, or hold until Q2 spec work lands.

    Option B — UNION patch in snapshot query (near-term, no guard change or spec PR needed):

    -- authorization-snapshot-db.ts:146-165 — add below catalog query:
    UNION ALL
    SELECT agent_url, publisher_domain, 'adagents_json' AS evidence, created_at
    FROM agent_publisher_authorizations
    WHERE source = 'adagents_json'
      AND publisher_domain IN (
        SELECT domain FROM publishers WHERE discovery_method = 'adagents_authoritative'
      )

    Closes snapshot gap now. Coupling precedent already set at federated-index-db.ts:195. Risk: #3177 step 5 (drop legacy tables) must account for snapshot dependency — but that step was already blocked by the same arm in the directory query.

    Option A — full defer (design call + WG spec PR first):

    // adagents.json spec — new normative clause needed before guard relaxation:
    + A publisher_properties[] cross-publisher claim (selector domains ≠ publisher domain)
    + is trusted if and only if the manager file's top-level properties[] carries at least
    + one entry whose publisher_domain matches the selector's listed child domain.
    + (Mirrors IAB sellers.json §4.3 intermediary-chain corroboration model.)

    WG must ratify this before publisher-db.ts:968-982 guard relaxation ships. Snapshot gap persists until spec PR + migration both land.

    @bokelley, your call: Option B (near-term UNION patch, closes snapshot gap now) or Option A / defer (design call first, WG spec PR for corroboration rule)?


    Triaged by Claude Code. Session: https://claude.ai/code/cse_01CFyah45Ygqfdv74XimgPoD


    Generated by Claude Code

  7. added
    needs-wg-review
    governance
    and removed
    claude-triaging
    on May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedenhancementgovernanceneeds-wg-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions