Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Resolves type name collision where two different Package types are both exported as "Package":

  • Full Package (package.json): Complete operational package with 12 fields for MediaBuy and updates
  • Created Package (create-media-buy-response.json): Minimal 2-field reference for creation responses

The code generator's collision handling exported the wrong one. This fix adds semantic aliases for clarity.

Changes

  • Package: Canonical alias for the full domain model (used in MediaBuy, updates, etc.)
  • CreatedPackageReference: New alias for the minimal response type (used in CreateMediaBuySuccessResponse)
  • Updated stable.py to import Package directly from package.py module to bypass collision
  • 7 comprehensive tests validating field structure and usage patterns

Test Results

All 18 type alias tests passing, including new Package-specific tests validating:

  • Correct field counts (12 vs 2)
  • Proper module resolution
  • Export chains from all levels (aliases → types → main package)
  • Instantiation in actual usage contexts

bokelley and others added 2 commits November 18, 2025 08:12
The AdCP schemas define two different types both named "Package":
- Full Package (package.json): Complete operational package with 12 fields
- Created Package (create-media-buy-response.json): Minimal reference with 2 fields

The code generator's "first wins" collision handling exported the response type,
shadowing the domain model. This fix adds semantic aliases:
- Package: The canonical full domain model (for MediaBuy, updates, etc.)
- CreatedPackageReference: Minimal response type (for CreateMediaBuy responses)

Imports Package directly from package.py module to bypass consolidation collision.
Includes 7 comprehensive tests validating field structure and usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed ruff linting issues that were causing CI failures:
- Auto-fixed import block sorting in multiple test files
- Split long assert messages across multiple lines
- Shortened docstrings to fit 100-character limit

All 282 tests still passing locally.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit b4028b7 into main Nov 18, 2025
7 checks passed
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