Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Replace all direct imports from adcp.types.generated_poc with imports from adcp.types._generated. This enforces the public API boundary and prevents both internal code and downstream users from depending on internal implementation details.

Changes

  • Update consolidate_exports.py to handle the Package name collision by exporting both types with qualified names
  • Migrate client.py, aliases.py, and stable.py to use _generated.py
  • Regenerate _generated.py with collision-resolved exports

Impact

The generated_poc/ directory is now truly internal. All public types flow through either adcp.types.stable or adcp.types.aliases, maintaining a clean API boundary.

🤖 Generated with Claude Code

bokelley and others added 6 commits November 18, 2025 20:19
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 bokelley merged commit 346689d into main Nov 19, 2025
7 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants