Title: types: 66 silent name collisions in adcp.types / _generated.py — adopters can't safely migrate off generated_poc · Issue #911 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: types: 66 silent name collisions in adcp.types / _generated.py — adopters can't safely migrate off generated_poc · Issue #911 · adcontextprotocol/adcp-client-python
X Title: types: 66 silent name collisions in adcp.types / _generated.py — adopters can't safely migrate off generated_poc · Issue #911 · adcontextprotocol/adcp-client-python
Description: Problem consolidate_exports.py flattens all generated_poc/ types into _generated.py using first-seen-wins (alphabetical sort). When multiple JSON schemas define a type with the same name, one class silently shadows the others. adcp.types...
Open Graph Description: Problem consolidate_exports.py flattens all generated_poc/ types into _generated.py using first-seen-wins (alphabetical sort). When multiple JSON schemas define a type with the same name, one class...
X Description: Problem consolidate_exports.py flattens all generated_poc/ types into _generated.py using first-seen-wins (alphabetical sort). When multiple JSON schemas define a type with the same name, one class...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/911
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"types: 66 silent name collisions in adcp.types / _generated.py — adopters can't safely migrate off generated_poc","articleBody":"## Problem\n\n`consolidate_exports.py` flattens all `generated_poc/` types into `_generated.py` using first-seen-wins (alphabetical sort). When multiple JSON schemas define a type with the same name, one class silently shadows the others. `adcp.types.__init__.py` re-exports from `_generated`, so `from adcp.types import X` may resolve to a different class than the adopter had from their deep `generated_poc` import.\n\nThe migration guide and codemod tell adopters \"import from `adcp.types` (stable public API) instead\", but for **66 type names** this advice silently swaps the underlying class.\n\n## Concrete examples (verified with `is` identity checks)\n\n| Symbol | `adcp.types` resolves to | Adopter likely needs | Fields match? |\n|--------|-------------------------|---------------------|---------------|\n| `Brand` | `protocol.get_adcp_capabilities_response` | `brand` (identity, with `names`, `logos`, etc.) | No — 5 vs 80+ fields |\n| `Creative` | `creative.get_creative_delivery_response` | `creative.list_creatives_response` | No — 6 vs 17+ fields |\n| `Account` | `core.account` | `account.sync_accounts_request` OR `sync_accounts_response` (3 different classes) | No |\n| `Sort` | `core.tasks_list_request` | `creative.list_creatives_request` | No |\n| `Authentication` | `account.sync_governance_request` | `core.push_notification_config` | No |\n| `Unit` | `enums.dimension_unit` | `core.duration` | No |\n| `MediaBuy` | `core.media_buy` | `protocol.get_adcp_capabilities_response` (for capabilities) | No |\n| `GovernanceAgent` | `account.sync_governance_request` | `core.account` | No |\n| `CreditLimit` | `account.sync_accounts_response` | `core.account` | No |\n\nFull list: 66 different-shape collisions across non-bundled modules. Only 5 names are in `known_collisions`; the remaining 61 are unhandled.\n\n## Impact on adopters\n\nsalesagent (first production adopter) has 85 `generated_poc` deep imports across 43 files. Following the migration guide, we attempted to rewrite all of them to `adcp.types`. The result:\n- ~40% were safe (class identity preserved)\n- ~60% silently swapped classes — code compiled, ruff passed, but mypy caught type mismatches for some; others would have been silent runtime bugs\n- The `GENERATED_POC_SYMBOL_MAP` in the codemod only covers 8 symbols; lines 148-157 of `v3_to_v4.py` acknowledge the problem for CreditLimit/Setup/GovernanceAgent but defer resolution\n\nThe current workaround (documented in `extending-types.md` via #644) is to import from the specific submodule. This is correct but means **the migration guide's primary advice is unsafe for most types**.\n\n## Proposed fix\n\n### Step 1: Make collisions loud (safety net)\n\nIn `consolidate_exports.py`, add a `collision_resolution` dict. Any collision not in `known_collisions` or `collision_resolution` **fails the build**. This prevents new silent collisions and forces explicit decisions on existing ones. ~50 lines.\n\n### Step 2: Add semantic aliases to `aliases.py`\n\nFor the 66 colliding names, add disambiguated aliases that adopters can import safely:\n\n```python\n# aliases.py additions\nfrom adcp.types.generated_poc.brand import Brand as BrandIdentity\nfrom adcp.types.generated_poc.creative.list_creatives_response import Creative as ListingCreative\nfrom adcp.types.generated_poc.creative.get_creative_delivery_response import Creative as DeliveryCreative\nfrom adcp.types.generated_poc.creative.sync_creatives_response import Creative as SyncCreativeResult\n# ... etc.\n```\n\nThis can be done incrementally — start with the high-impact names above and expand as adopters report needs.\n\n### Step 3: Expand the codemod's per-symbol map\n\nAdd source-module metadata to `GENERATED_POC_SYMBOL_MAP` so `--auto-apply` can generate precise rewrites instead of the generic \"import from adcp.types\" hint.\n\n## Relation to existing work\n\n- #642 (closed as \"not actionable on SDK side\") — this proposes the actionable SDK-side fix\n- #710 (SchemaVariant) — solves the mypy noise but not the silent-swap problem\n- adcontextprotocol/adcp#4347 (spec-level rename, milestoned to 4.0) — the long-term fix; this issue is the SDK-side mitigation until that lands","author":{"url":"https://github.com/KonstantinMirin","@type":"Person","name":"KonstantinMirin"},"datePublished":"2026-06-04T15:25:19Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/911"}
| 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:d2e37dd5-9f84-d098-dd78-c784a2a4fd0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81CC:229B2E:B37456:EEC8AC:6B00ED44 |
| html-safe-nonce | 8cda63360c4bffacf3bd181d640c5c280713b2b1736c5b46502c2045d741aa52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUNDOjIyOUIyRTpCMzc0NTY6RUVDOEFDOjZCMDBFRDQ0IiwidmlzaXRvcl9pZCI6IjUyNTQ1OTkyNDQyNDEyNTc2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e8bdb91c259cd8b49d8876f9e95398861dd259c4bf560ae7d7e5e068e803edd3 |
| hovercard-subject-tag | issue:4589944245 |
| 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/911/issue_layout |
| twitter:image | https://opengraph.githubassets.com/da1f018088f6688aad7cf4511cc150900389b4dbfc0cc73dbe291785fc9b40f4/adcontextprotocol/adcp-client-python/issues/911 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/da1f018088f6688aad7cf4511cc150900389b4dbfc0cc73dbe291785fc9b40f4/adcontextprotocol/adcp-client-python/issues/911 |
| og:image:alt | Problem consolidate_exports.py flattens all generated_poc/ types into _generated.py using first-seen-wins (alphabetical sort). When multiple JSON schemas define a type with the same name, one class... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KonstantinMirin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width