feat(decisioning): emit UserWarning for sales-* methods required in v6.0 rc.1#434
Closed
feat(decisioning): emit UserWarning for sales-* methods required in v6.0 rc.1#434
Conversation
…6.0 rc.1 Adds WARN_IF_MISSING_PER_SPECIALISM constant and a new warning loop in validate_platform() that surfaces the 4 methods promoted to required in v6.0 rc.1 (get_media_buys, provide_performance_feedback, list_creative_formats, list_creatives) as boot-time UserWarnings rather than silently tolerating their absence. Closes #423 https://claude.ai/code/session_01GovN4hXXs27SNeNbBeFRgg
- Include platform class name (type(platform).__qualname__) in warning message so CI logs point at the concrete subclass - Remove WARN_IF_MISSING_PER_SPECIALISM from __all__ (migration artifact, not stable public API) - Fix sales.py module docstring: move sync_catalogs to its own "hard-enforced" section (it was miscategorized under warn-if-absent) - Update # ---- Optional ---- inline comment to warn-if-absent - Update stale REQUIRED_METHODS_PER_SPECIALISM comment https://claude.ai/code/session_01GovN4hXXs27SNeNbBeFRgg
3 tasks
Contributor
Author
Contributor
Author
|
Acknowledged — #445 supersedes this. Nothing further from triage. Generated by Claude Code |
Contributor
Author
|
Understood — noted that #445 supersedes this PR. No further triage action on #434. Generated by Claude Code |
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
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.
Closes #423
validate_platform()now surfaces the foursales-*methods that the spec promotes to required in v6.0 rc.1 —get_media_buys,provide_performance_feedback,list_creative_formats,list_creatives— as boot-timeUserWarnings rather than silently tolerating their absence. A v3 ref seller would have shipped without them; this catches that class of gap at server boot.What changed
src/adcp/decisioning/dispatch.pyWARN_IF_MISSING_PER_SPECIALISMconstant mapping all sixsales-*specialisms to the four rc.1-promoted methods (private_SALES_WARN_IF_MISSINGfrozenset shared across all six entries)validate_platform(), after the governance gate, that emits oneUserWarningper missing method — deduplicated across multi-specialism claims (e.g., a platform claiming bothsales-non-guaranteedandsales-guaranteedwarns once per method, not twice)type(platform).__qualname__so CI logs point at the adopter's file, and describes the consequence (AdcpError(NOT_SUPPORTED)at buyer call time)REQUIRED_METHODS_PER_SPECIALISMto say "warn-if-absent" instead of "present-or-absent, not enforced here"src/adcp/decisioning/specialisms/sales.pysync_catalogs# ---- Optional (gated by specialism — present-or-absent) ----inline comment updated to# ---- Warn-if-absent (required in v6.0 rc.1 — hard-enforced at rc.1) ----sales-*specialism in v6.0 rc.1+" to "UserWarning at boot / hard-error in v6.0 rc.1"tests/test_decisioning_dispatch.py_ValidPlatformfixture upgraded from 5 → 9 methods (adds the four warn-if-absent stubs) so the "happy path" fixture is fully compliant and emits no warningsWhat tested
pytest tests/test_decisioning_dispatch.py— 42 passed (38 original + 4 new), 0 failedpytest tests/test_decisioning_advertised_per_specialism.py— 9 passed, 0 failedruff check src/adcp/decisioning/dispatch.py src/adcp/decisioning/specialisms/sales.py— all checks passedmypy src/adcp/decisioning/dispatch.py src/adcp/decisioning/specialisms/sales.py— no issues foundPre-PR review
REQUIRED_METHODS_PER_SPECIALISM(fixed in second commit)sync_catalogsmoved out of warn-if-absent section,# ---- Optional ----comment updated; nits on__qualname__in message and__all__(both fixed)Migration path to v6.0 rc.1
When rc.1 ships: move the four methods from
WARN_IF_MISSING_PER_SPECIALISMintoREQUIRED_METHODS_PER_SPECIALISMand drop them from the warn dict. The existing hard-error path invalidate_platform()takes over. No new code needed.Session: https://claude.ai/code/session_01GovN4hXXs27SNeNbBeFRgg
Generated by Claude Code