Commit 346689d
refactor: remove direct generated_poc imports (#65)
* refactor: remove direct generated_poc imports
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>
* fix: enforce import boundary - only stable.py/aliases.py may use _generated
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>
* fix: sort imports to pass ruff linter
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>
* chore: remove review artifacts from commit history
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>
* fix: resolve PublisherProperties name collision with qualified exports
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>
* feat: adopt shared PublisherPropertySelector schema from upstream
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>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9f63373 commit 346689d
File tree
19 files changed
+728
-712
lines changed- schemas/cache
- 1.0.0
- scripts
- src/adcp
- types
- generated_poc
- utils
- tests
19 files changed
+728
-712
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 24 | + | |
28 | 25 | | |
29 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
30 | 63 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 64 | + | |
| 65 | + | |
34 | 66 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
38 | 72 | | |
39 | 73 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
45 | 98 | | |
46 | 99 | | |
47 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 357 | + | |
419 | 358 | | |
420 | 359 | | |
421 | 360 | | |
| |||
487 | 426 | | |
488 | 427 | | |
489 | 428 | | |
490 | | - | |
| 429 | + | |
491 | 430 | | |
492 | 431 | | |
493 | 432 | | |
| |||
0 commit comments