Title: feat(decisioning): state-machine helpers + typed exception classes + refAccountId · Issue #455 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: feat(decisioning): state-machine helpers + typed exception classes + refAccountId · Issue #455 · adcontextprotocol/adcp-client-python
X Title: feat(decisioning): state-machine helpers + typed exception classes + refAccountId · Issue #455 · adcontextprotocol/adcp-client-python
Description: Parent: #452 Three small mechanical helpers bundled together because they all eliminate the same class of open-coding. (a) State-machine transition helpers from adcp.decisioning import ( MEDIA_BUY_TRANSITIONS, assert_media_buy_transition...
Open Graph Description: Parent: #452 Three small mechanical helpers bundled together because they all eliminate the same class of open-coding. (a) State-machine transition helpers from adcp.decisioning import ( MEDIA_BUY_...
X Description: Parent: #452 Three small mechanical helpers bundled together because they all eliminate the same class of open-coding. (a) State-machine transition helpers from adcp.decisioning import ( MEDIA_BUY_...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/455
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(decisioning): state-machine helpers + typed exception classes + refAccountId","articleBody":"Parent: #452\n\nThree small mechanical helpers bundled together because they all eliminate the same class of open-coding.\n\n## (a) State-machine transition helpers\n\n```python\nfrom adcp.decisioning import (\n MEDIA_BUY_TRANSITIONS,\n assert_media_buy_transition,\n CREATIVE_ASSET_TRANSITIONS,\n assert_creative_transition,\n)\n\nassert_media_buy_transition(from_state=\"active\", to_state=\"completed\") # ok\nassert_media_buy_transition(from_state=\"completed\", to_state=\"active\") # raises INVALID_REQUEST\n```\n\n`MEDIA_BUY_TRANSITIONS` is a `dict[State, set[State]]` mapping. Same shape for creatives.\n\n## (b) Typed exception classes\n\nSubclasses of `AdcpError` with the correct error code + recovery semantic baked in:\n\n- `PermissionDeniedError(action: str, **details)`\n- `AuthRequiredError(**details)`\n- `ServiceUnavailableError`\n- `RateLimitedError`\n- `MediaBuyNotFoundError`\n- `AccountNotFoundError`\n- `BillingNotPermittedForAgentError`\n- `ValidationError`\n\nToday adopters either raise generic `AdcpError(code=...)` (verbose) or hand-roll subclasses each time.\n\n## (c) `ref_account_id` helper\n\nDrops `'account_id' in ref ? ref.account_id : None` open-coding:\n\n```python\nfrom adcp.decisioning import ref_account_id\n\nacct_id = ref_account_id(ref) # str | None\n```\n\n## JS source\n\n`.changeset/auto-seed-symmetric-resolution.md` and recipe #14 in 6.7 migration guide.\n\n## Acceptance criteria\n\n- All three helpers + 8 typed exceptions exported from `adcp.decisioning`.\n- Tests verify error codes match spec.\n- Will hit `examples/v3_reference_seller/src/platform.py` lines that hand-roll status maps; refactor demo deferred.\n\n## Note on credential-leak strip\n\nFolding credential write-only-strip from the original \"issue 11\" plan into #4 (`AccountStore.sync_governance(ctx)`), since the strip happens at the AccountStore emit boundary.","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-03T11:28:31Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/455"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:658ff8d3-b4c0-d926-292d-3b626e48c45f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9FC:B53AF:D9F920:1230563:6B0101CD |
| html-safe-nonce | 1b79aede1e2a546a599afc250dd56c14d3a5853382293132963510a0a19c66ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUZDOkI1M0FGOkQ5RjkyMDoxMjMwNTYzOjZCMDEwMUNEIiwidmlzaXRvcl9pZCI6IjI2NTExMDAzMzA4MjkzNDkzMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4be92f38e31acf012fb5af4a14f173a7f61d4ad0ed8674bd32af703803fc556e |
| hovercard-subject-tag | issue:4371630764 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adcontextprotocol/adcp-client-python/455/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5fa9c10bd59369b5a11c1d81c20fc5d92725d46b2781569defff8b19df866b63/adcontextprotocol/adcp-client-python/issues/455 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5fa9c10bd59369b5a11c1d81c20fc5d92725d46b2781569defff8b19df866b63/adcontextprotocol/adcp-client-python/issues/455 |
| og:image:alt | Parent: #452 Three small mechanical helpers bundled together because they all eliminate the same class of open-coding. (a) State-machine transition helpers from adcp.decisioning import ( MEDIA_BUY_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bokelley |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git |
| octolytics-dimension-user_id | 221690821 |
| octolytics-dimension-user_login | adcontextprotocol |
| octolytics-dimension-repository_id | 1090305973 |
| octolytics-dimension-repository_nwo | adcontextprotocol/adcp-client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1090305973 |
| octolytics-dimension-repository_network_root_nwo | adcontextprotocol/adcp-client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width