Title: feat(examples): multi-platform-per-process proof — mock platforms with PlatformRouter, refactor v3 reference seller along the way · Issue #477 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: feat(examples): multi-platform-per-process proof — mock platforms with PlatformRouter, refactor v3 reference seller along the way · Issue #477 · adcontextprotocol/adcp-client-python
X Title: feat(examples): multi-platform-per-process proof — mock platforms with PlatformRouter, refactor v3 reference seller along the way · Issue #477 · adcontextprotocol/adcp-client-python
Description: Context The SDK ships DecisioningPlatform + specialism mixins as the platform contract. Adopters subclass once per platform, declare capabilities, implement specialism methods. Today we have one worked example — examples/v3_reference_sel...
Open Graph Description: Context The SDK ships DecisioningPlatform + specialism mixins as the platform contract. Adopters subclass once per platform, declare capabilities, implement specialism methods. Today we have one wo...
X Description: Context The SDK ships DecisioningPlatform + specialism mixins as the platform contract. Adopters subclass once per platform, declare capabilities, implement specialism methods. Today we have one wo...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/477
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(examples): multi-platform-per-process proof — mock platforms with PlatformRouter, refactor v3 reference seller along the way","articleBody":"## Context\n\nThe SDK ships `DecisioningPlatform` + specialism mixins as the platform contract. Adopters subclass once per platform, declare capabilities, implement specialism methods. Today we have one worked example — `examples/v3_reference_seller/` — which assumes **one platform per process, one tenant per platform** (the upstream HTTP client is held on `__init__`).\n\nMulti-tenant SaaS sales agents (e.g. Prebid's salesagent) need the opposite shape: **N platforms per process, dispatched per tenant**. That pattern doesn't have a worked example in the SDK today, even though `DecisioningPlatform` supports it cleanly via composition.\n\nThis issue (a) builds the worked example with two pure-Python in-process mock platforms, (b) ships the `PlatformRouter` recipe, and (c) refactors the v3 reference seller to use the same pattern as a degenerate single-platform case so we have one consistent way to compose platforms.\n\n## Goal\n\nStand up `examples/multi_platform_seller/` that:\n\n1. Boots a single `serve()` process.\n2. Hosts two tenants, each backed by a different `DecisioningPlatform` subclass.\n3. Passes the `media_buy_seller` storyboard for both tenants.\n4. Doubles as the migration target for salesagent-style adapter-registry architectures.\n\n## Non-goals\n\n- Not adding new SDK runtime — the `PlatformRouter` lands as an example recipe first. If the pattern proves out, we promote it into `adcp.decisioning.dispatch` in a follow-up.\n- Not pulling in the JS mock-server. These are pure-Python in-process platforms — easier to read, easier to test, easier to fork.\n- Not adding new platform specialisms — both mocks claim `sales-non-guaranteed` and `sales-guaranteed`. Multi-protocol bridging is a separate seam.\n\n## Scope\n\n### 1. `MockGuaranteedPlatform(DecisioningPlatform, SalesPlatform)`\n\nIn-process, fixed-allocation. Models pre-bookable inventory: `create_media_buy` reserves capacity from a finite pool; rejects when sold out. Status lifecycle exercises `pending_creatives → pending_start → active → completed`. Pricing fixed CPM.\n\n### 2. `MockNonGuaranteedPlatform(DecisioningPlatform, SalesPlatform)`\n\nIn-process, auction-time allocation. Models programmatic remnant: `create_media_buy` always succeeds, delivery scales with budget, status starts `active`. Pricing variable CPM with floor.\n\n### 3. `PlatformRouter`\n\nA `DecisioningPlatform` subclass that holds a `dict[tenant_id, DecisioningPlatform]` and delegates each method to the resolved platform. Wired via tenant `ResolveContext`. Minimal — fewer than 200 LOC.\n\n```python\nrouter = PlatformRouter({\n \"tenant-a\": MockGuaranteedPlatform(...),\n \"tenant-b\": MockNonGuaranteedPlatform(...),\n})\nserve(router, transport=\"both\", asgi_middleware=[SubdomainTenantMiddleware(...)])\n```\n\n### 4. Storyboard validation\n\n`media_buy_seller` storyboard passes for both tenants. Tested via the existing storyboard runner with separate subdomain → tenant routing.\n\n### 5. README + migration doc\n\n`examples/multi_platform_seller/MIGRATION_FROM_ADAPTER_REGISTRY.md` — explicit translation table from salesagent's `ADAPTER_REGISTRY` / `AdServerAdapter` model to `PlatformRouter` + `DecisioningPlatform + SalesPlatform`.\n\n### 6. Refactor `examples/v3_reference_seller/` (the bundled work)\n\nThe reference seller currently has its own ad-hoc tenant routing logic. Refactor to:\n\n- Use `PlatformRouter` as the entry point even though it has only one platform — the degenerate case is the migration target for new adopters who'll add platforms later.\n- Move the upstream HTTP client into the platform's `__init__` (already there) but wire the router's tenant lookup consistently with the new examples.\n- Update `MIGRATION.md` to reference the multi-platform doc as the next step.\n\nThis refactor is unavoidable once we ship `PlatformRouter` — the reference seller becomes inconsistent if we don't update it. Bundling keeps the docs coherent.\n\n## Acceptance criteria\n\n- [ ] `examples/multi_platform_seller/` directory exists with the two mock platforms + router + README\n- [ ] Storyboard run (`@adcp/client adcp storyboard run ...`) passes for both tenant subdomains\n- [ ] `MIGRATION_FROM_ADAPTER_REGISTRY.md` documents the translation from salesagent-shaped adapter code\n- [ ] `examples/v3_reference_seller/` uses `PlatformRouter` (degenerate single-platform case)\n- [ ] `examples/v3_reference_seller/MIGRATION.md` updated to point at the multi-platform example\n- [ ] CI: new `pytest` integration test that boots `multi_platform_seller` and runs at least one tool against each tenant\n- [ ] No regressions in existing reference-seller tests\n\n## Out of scope (separate issues)\n\n- Promoting `PlatformRouter` into `adcp.decisioning.dispatch` (do this after the example proves out)\n- Capability projection completeness (separate PR — see corresponding issue)\n- Multi-protocol buyer bridge — speculative, hold until needed\n- Performance / scale testing of the router — single-process latency is fine for the example","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-03T14:18:58Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/477"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a846f123-53de-677c-81ea-f5220b60a560 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0C2:296654:BE5D03:100371B:6B00F865 |
| html-safe-nonce | 03a04dbd37c0df5ee43e02b083ad55faf7364b28096611603242a03feaebdc1f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEMyOjI5NjY1NDpCRTVEMDM6MTAwMzcxQjo2QjAwRjg2NSIsInZpc2l0b3JfaWQiOiIzOTY3MzY3MDQzNzk1MTg3ODEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0d152c22582dcfb1b6672d6b813d47f074cfa2e1f08b43efa7bbdc30620c19a3 |
| hovercard-subject-tag | issue:4372033882 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adcontextprotocol/adcp-client-python/477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a778b849e82695a31da5dbe9e6fb7d7df1ad50d0090768fb48180f3c1ce0aa02/adcontextprotocol/adcp-client-python/issues/477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a778b849e82695a31da5dbe9e6fb7d7df1ad50d0090768fb48180f3c1ce0aa02/adcontextprotocol/adcp-client-python/issues/477 |
| og:image:alt | Context The SDK ships DecisioningPlatform + specialism mixins as the platform contract. Adopters subclass once per platform, declare capabilities, implement specialism methods. Today we have one wo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bokelley |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git |
| octolytics-dimension-user_id | 221690821 |
| octolytics-dimension-user_login | adcontextprotocol |
| octolytics-dimension-repository_id | 1090305973 |
| octolytics-dimension-repository_nwo | adcontextprotocol/adcp-client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1090305973 |
| octolytics-dimension-repository_network_root_nwo | adcontextprotocol/adcp-client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width