Skip to content

feat(decisioning): MockAdServer Protocol + /_debug/traffic counters for anti-façade compliance #383

@bokelley

Description

@bokelley

Context

Adopter platform methods that return empty without calling anything (e.g. sync_creatives[], get_media_buy_delivery[]) violate AdCP's anti-façade contract introduced in adcp PR #3816. Today there is no machine-checkable way to assert "this method actually made a downstream call to the ad server" — storyboard runs pass even when the platform is a no-op.

Cross-link: existing issue #347 (upstream-traffic recorder middleware) — this issue is the platform-side bookend. #347 records HTTP traffic the SDK emits; this issue records the calls the platform attempts to make to the ad server.

Refs:

  • examples/v3_reference_seller/src/platform.py
  • adcp PR #3816 (anti-façade contract)

Acceptance Criteria

  • MockAdServer Protocol (or ABC) defined in the decisioning toolkit — the contract every platform method should call into for upstream operations (push creative, push media buy, fetch delivery, etc.)
  • Default impl with traffic counters (per-method call count, last-call timestamp, last-call args)
  • /_debug/traffic endpoint exposes the counters, gated behind a debug flag
  • V3 reference seller's platform.py rewired to call the MockAdServer for every spec operation
  • Storyboard runner can assert traffic.sync_creatives.call_count >= 1 after a sync_creatives storyboard
  • Cross-linked to feat(testing): reference upstream-traffic recorder middleware for query_upstream_traffic adopters (adcp#3830 item 4) #347 in description

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions