You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The generated_poc.brand alias resolves to the wrong half of a split, so Brand, BrandDiscovery3 and LocalizedName raise ImportError through it #1402
The generated_poc compatibility alias for the brand module resolves to a module that does not contain the names it is supposed to alias.
>>>importimportlib>>>importlib.import_module("adcp.types.generated_poc.brand").__name__'adcp.types.domains.brand'# the module imports fine>>>fromadcp.types.generated_poc.brandimportBrandImportError: cannotimportname'Brand'from'adcp.types.domains.brand'>>>importadcp.types.domains.brand_discoveryasbd>>>hasattr(bd, "Brand")
True
Brand, BrandDiscovery3 and LocalizedName moved to domains.brand_discovery when brand was split, but the alias maps generated_poc.brand → domains.brand. The module resolves; every one of those three names raises.
Why it matters
A compatibility alias that resolves the module and not its contents is worse than no alias: the ImportError names adcp.types.domains.brand, a module the adopter never wrote and cannot find in their own source. With no alias the error would at least have named generated_poc.brand and pointed at the thing to change.
Proposed fix
Map the alias per name, not per module, wherever a generated_poc module was split — or point generated_poc.brand at domains.brand_discovery if that is where the whole of the old module's contents went. A test that imports every name the old generated_poc tree exported, through the alias, would have caught this and would catch the next split.
Context
Descendant of #911 (silent name collisions in adcp.types / _generated.py) and of the alias mechanism added in #1392. Found while moving an adopter off generated_poc entirely: 125 references across 38 files, now 0 — this was the one that did not survive the alias.
Classification: Bug Bucket(s): client (types / alias layer) Status: deferred — fold-candidate into #1392 Milestone: —
What the experts said:
code-reviewer: Bug confirmed — domains/brand/__init__.py exports only API-endpoint types (no Brand, BrandDiscovery3, LocalizedName); those three names live in domains/brand_discovery/__init__.py, which is exactly where generated_poc/brand_discovery.py migrated to. The tombstone entry for generated_poc.brand names the wrong destination.
dx-expert: A tombstone that silently resolves the module and then raises ImportError: cannot import name 'Brand' from 'adcp.types.domains.brand' is worse than the bare ModuleNotFoundError it replaced — the adopter is given a path they can't find in their own codebase, and no hint that the three missing names are one word away in domains.brand_discovery.
My take: The bug is squarely inside PR #1392: the tombstone's per-module redirect table maps generated_poc.brand → domains.brand, but Brand, BrandDiscovery3, and LocalizedName never lived in the brand/package — they lived in the flat brand_discovery.py file beside it, which maps to domains.brand_discovery. The fix is per-name overrides in the tombstone for this split case (or pointing the brand tombstone at brand_discovery if the whole public surface landed there). A test that imports every name the old generated_poc tree surfaced through the tombstone would prevent this class of regression from any future split.
Activity
bokelley commentedon Oct 6, 2026
Triage
Classification: Bug
Bucket(s): client (types / alias layer)
Status: deferred — fold-candidate into #1392
Milestone: —
What the experts said:
domains/brand/__init__.pyexports only API-endpoint types (noBrand,BrandDiscovery3,LocalizedName); those three names live indomains/brand_discovery/__init__.py, which is exactly wheregenerated_poc/brand_discovery.pymigrated to. The tombstone entry forgenerated_poc.brandnames the wrong destination.ImportError: cannot import name 'Brand' from 'adcp.types.domains.brand'is worse than the bareModuleNotFoundErrorit replaced — the adopter is given a path they can't find in their own codebase, and no hint that the three missing names are one word away indomains.brand_discovery.My take: The bug is squarely inside PR #1392: the tombstone's per-module redirect table maps
generated_poc.brand → domains.brand, butBrand,BrandDiscovery3, andLocalizedNamenever lived in thebrand/package — they lived in the flatbrand_discovery.pyfile beside it, which maps todomains.brand_discovery. The fix is per-name overrides in the tombstone for this split case (or pointing thebrandtombstone atbrand_discoveryif the whole public surface landed there). A test that imports every name the oldgenerated_poctree surfaced through the tombstone would prevent this class of regression from any future split.Blocked-on: #1392 — resurfaces on merge
Triaged by Claude Code. Session: https://claude.ai/code/session_018p8ZYcpxokvNiFFJ2si8Rg
Generated by Claude Code
fix(types): serve a split generated_poc module from both of its halves
docs: name the one generated_poc stem that split, where an adopter re…
refactor(codegen)!: make the generated domain tree the one public typ…