Title: feat(server): composeMethod — typed before/after hooks with {shortCircuit: T} discriminated wrapper · Issue #454 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: feat(server): composeMethod — typed before/after hooks with {shortCircuit: T} discriminated wrapper · Issue #454 · adcontextprotocol/adcp-client-python
X Title: feat(server): composeMethod — typed before/after hooks with {shortCircuit: T} discriminated wrapper · Issue #454 · adcontextprotocol/adcp-client-python
Description: Parent: #452 JS source .changeset/compose-method-helper.md (6.7). Pattern Wrap individual DecisioningPlatform methods with hooks: before(params) -> ShortCircuit | None. Return None to fall through to inner method, or {"short_circuit": va...
Open Graph Description: Parent: #452 JS source .changeset/compose-method-helper.md (6.7). Pattern Wrap individual DecisioningPlatform methods with hooks: before(params) -> ShortCircuit | None. Return None to fall through ...
X Description: Parent: #452 JS source .changeset/compose-method-helper.md (6.7). Pattern Wrap individual DecisioningPlatform methods with hooks: before(params) -> ShortCircuit | None. Return None to fall throu...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/454
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(server): composeMethod — typed before/after hooks with {shortCircuit: T} discriminated wrapper","articleBody":"Parent: #452\n\n## JS source\n\n`.changeset/compose-method-helper.md` (6.7).\n\n## Pattern\n\nWrap individual `DecisioningPlatform` methods with hooks:\n\n- `before(params) -> ShortCircuit | None`. Return `None` to fall through to inner method, or `{\"short_circuit\": value}` to skip the inner method and use `value` as the result.\n- `after(result, params, ctx) -> result` runs on the result whether it came from the inner method OR a `before` short-circuit.\n- Critically: `after` runs BEFORE response-schema validation, so adopters can tweak shape before the framework validates.\n\n## Proposed API\n\n```python\nfrom adcp.decisioning import compose_method, require_account_match, require_advertiser_match, require_org_scope\n\nplatform.create_media_buy = compose_method(\n inner=platform.create_media_buy,\n before=require_account_match, # raises PERMISSION_DENIED if mismatch\n after=lambda result, params, ctx: ..., # echo back custom fields\n)\n```\n\nSecurity composers (each is a valid `before` hook):\n\n- `require_account_match` — fails if `params.account_id` doesn't match resolved auth principal's account.\n- `require_advertiser_match` — fails if `params.advertiser_id` not in resolved principal's advertisers.\n- `require_org_scope` — fails if resolved principal isn't operator-scoped.\n\nAll raise typed `PermissionDeniedError` (#3).\n\n## Acceptance criteria\n\n- `compose_method` helper exported from `adcp.decisioning`.\n- 3 security composers exported.\n- Tests cover: before-only, after-only, both, short-circuit path, exception in before propagates, after runs on short-circuited result.","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-03T11:28:19Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/454"}
| 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:a67e4b86-e02e-91ac-dac4-0bb5fa452bcd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E270:14ECB:B04CCD:E18CC6:6B00F721 |
| html-safe-nonce | e78edb06193394f13fe26689c6139a506cfaca6e7f740d10b215f4e09988b9ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjcwOjE0RUNCOkIwNENDRDpFMThDQzY6NkIwMEY3MjEiLCJ2aXNpdG9yX2lkIjoiNDc0NTU3MTI3NDgwNDIyOTkyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bbe316b5331693ec297558dbc8cb88432f314c920e1796daf0b2a0d0bedf01e8 |
| hovercard-subject-tag | issue:4371630198 |
| 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/454/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ed270712adffeb396e2c8c854b1706a10c6799e30330389d92def1071120e5a1/adcontextprotocol/adcp-client-python/issues/454 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ed270712adffeb396e2c8c854b1706a10c6799e30330389d92def1071120e5a1/adcontextprotocol/adcp-client-python/issues/454 |
| og:image:alt | Parent: #452 JS source .changeset/compose-method-helper.md (6.7). Pattern Wrap individual DecisioningPlatform methods with hooks: before(params) -> ShortCircuit | None. Return None to fall through ... |
| 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 | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width