-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: remove direct generated_poc imports #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace all direct imports from adcp.types.generated_poc with imports from adcp.types._generated. This enforces the public API boundary and prevents downstream users from depending on internal implementation details. Changes: - Update consolidate_exports.py to handle Package name collision by exporting both types with qualified names (_PackageFromPackage, _PackageFromCreateMediaBuyResponse) - Migrate client.py to import TaskStatus from _generated - Migrate aliases.py to import all types from _generated - Migrate stable.py to import Package from _generated using qualified name - Regenerate _generated.py with collision-resolved exports This ensures that: 1. generated_poc directory remains internal (not part of public API) 2. All type consolidation happens in _generated.py 3. Only stable.py and aliases.py provide public type exports 4. Users import from adcp or adcp.types.stable, not internal modules 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…erated
Source code was incorrectly importing from _generated.py, making it just as
brittle as importing from generated_poc. This fixes the architecture to
properly enforce the public API boundary.
Changes:
- Add WebhookPayload to stable.py exports
- Change client.py, __init__.py, simple.py to import from stable.py
- Change preview_cache.py to use semantic aliases (PreviewCreativeFormatRequest)
- Document import architecture rules in CLAUDE.md
Import architecture (enforced):
```
generated_poc/*.py (internal)
↓
_generated.py (internal consolidation)
↓
stable.py + aliases.py (ONLY files that import from _generated)
↓
All other source code (imports from stable/aliases only)
```
This prevents brittleness from:
- Collision-resolution qualifiers (_PackageFromX)
- Numbered discriminated union types (Response1, Response2)
- Schema evolution changes in generated files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Ruff check was failing due to unsorted imports. Fixed by running ruff --fix. Changes: - Sort imports in __init__.py according to isort rules - Sort imports in client.py - Sort imports in aliases.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The ARCHITECTURE_REVIEW.md, PR65_EVALUATION.md, and type_collision_demo.py were created by review agents as deliverables but shouldn't be part of the repository. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The consolidation script now handles PublisherProperties name collisions between adagents and product modules by exporting both with qualified names: - _PublisherPropertiesFromProduct (used for semantic aliases) - _PublisherPropertiesFromAdagents - _PublisherProperties4FromProduct (by_id discriminator) - _PublisherProperties5FromProduct (by_tag discriminator) Updated aliases.py and tests to use qualified names from _generated.py instead of importing directly from generated_poc modules, enforcing proper import boundaries. All 295 tests pass. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
After upstream PR #219 merged, the PublisherProperties type is now defined in a shared publisher-property-selector.json schema with all 3 variants (all, by_id, by_tag). Changes: - Synced schemas from upstream (now includes publisher-property-selector.json) - Regenerated types (PublisherPropertySelector1/2/3 from shared schema) - Removed PublisherProperties from collision handling in consolidate_exports.py - Updated aliases.py to use PublisherPropertySelector types - Updated tests to reference shared types instead of module-specific variants Benefits: - Single source of truth for publisher property selection - No more name collisions between adagents and product modules - Simplified type system with cleaner exports - DRY schema definitions maintained upstream All 295 tests pass. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
bokelley
added a commit
that referenced
this pull request
Nov 19, 2025
The refactor in PR #65 enforces the public API boundary by removing direct imports from generated_poc. This is an important fix that prevents users from depending on internal implementation details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
bokelley
added a commit
that referenced
this pull request
Nov 19, 2025
The refactor in PR #65 enforces the public API boundary by removing direct imports from generated_poc. This is an important fix that prevents users from depending on internal implementation details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace all direct imports from
adcp.types.generated_pocwith imports fromadcp.types._generated. This enforces the public API boundary and prevents both internal code and downstream users from depending on internal implementation details.Changes
consolidate_exports.pyto handle the Package name collision by exporting both types with qualified namesclient.py,aliases.py, andstable.pyto use_generated.py_generated.pywith collision-resolved exportsImpact
The
generated_poc/directory is now truly internal. All public types flow through eitheradcp.types.stableoradcp.types.aliases, maintaining a clean API boundary.🤖 Generated with Claude Code