Title: feat(buyer-agent-registry): with_full_stack() — compose caching + rate-limiting + auditing in one factory · Issue #697 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: feat(buyer-agent-registry): with_full_stack() — compose caching + rate-limiting + auditing in one factory · Issue #697 · adcontextprotocol/adcp-client-python
X Title: feat(buyer-agent-registry): with_full_stack() — compose caching + rate-limiting + auditing in one factory · Issue #697 · adcontextprotocol/adcp-client-python
Description: Follow-up to #380 / #692. Context PgBuyerAgentRegistry.with_caching(**kwargs) shipped in #692 collapses cache wiring into one call. But the canonical production stack documented in registry_cache.py is three layers: Caching(RateLimited(A...
Open Graph Description: Follow-up to #380 / #692. Context PgBuyerAgentRegistry.with_caching(**kwargs) shipped in #692 collapses cache wiring into one call. But the canonical production stack documented in registry_cache.p...
X Description: Follow-up to #380 / #692. Context PgBuyerAgentRegistry.with_caching(**kwargs) shipped in #692 collapses cache wiring into one call. But the canonical production stack documented in registry_cache.p...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/697
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(buyer-agent-registry): with_full_stack() — compose caching + rate-limiting + auditing in one factory","articleBody":"Follow-up to #380 / #692.\n\n## Context\n\n`PgBuyerAgentRegistry.with_caching(**kwargs)` shipped in #692 collapses cache wiring into one call. But the canonical production stack documented in [`registry_cache.py`](https://github.com/adcontextprotocol/adcp-client-python/blob/main/src/adcp/decisioning/registry_cache.py#L1-L30) is three layers:\n\n```\nCaching(RateLimited(Auditing(inner)))\n```\n\nAdopters who want the full stack still hand-compose:\n\n```python\npg = PgBuyerAgentRegistry(pool=pool)\naudited = AuditingBuyerAgentRegistry(pg, audit_sink=sink)\nlimited = RateLimitedBuyerAgentRegistry(audited, rps_per_tenant=100, audit_sink=sink)\ncache = CachingBuyerAgentRegistry(limited, ttl_seconds=60, audit_sink=sink)\npg.add_mutation_observer(lambda _op, _url: cache.clear_sync())\nserve(buyer_agent_registry=cache, ...)\n```\n\nThe mutation-observer wiring at the end is the part most adopters will forget.\n\n## Proposed\n\n```python\nregistry = PgBuyerAgentRegistry(pool=pool).with_full_stack(\n ttl_seconds=60,\n max_entries=10_000,\n rps_per_tenant=100,\n audit_sink=sink,\n)\nserve(buyer_agent_registry=registry, ...)\n```\n\nReturns the outermost `CachingBuyerAgentRegistry`, pre-wired with the mutation observer, with `audit_sink` threaded through every layer that accepts one.\n\n## Tradeoffs\n\n- More opinionated than `with_caching` — fixes a layer order (\\`Cache -> RateLimit -> Audit -> inner\\`). Adopters who need a different order still go manual.\n- Worth doing because the current manual path is the most-foot-shootable section of the registry composition story.\n\n## Alternative considered\n\nStacking method-chained factories (`pg.with_caching(...).with_rate_limiting(...).with_auditing(...)`) reads nicely but inverts the layer order — `Auditing` would end up outermost, which is wrong for this use case. The single-call factory dodges that confusion.\n\n## Acceptance\n\n- `with_full_stack(**kwargs)` on `PgBuyerAgentRegistry`\n- `audit_sink` parameter threaded to all three wrapper layers (so cache/rate-limit/resolve events all emit)\n- Conformance test: mutation through `pg` invalidates cache; rate-limit fires on burst; audit events emitted at each layer\n- Docstring documents layer order and points to manual composition for non-default orderings","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-05-12T15:07:46Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/697"}
| 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:a58e7258-d51e-c798-546c-62d8e262e065 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 932C:24ACB9:10B8236:160DB3F:6B01097A |
| html-safe-nonce | 8b6ecae96c79ecd6c335539d99a61d93ac3d48c4c48bbc59bfaec89789e88280 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzJDOjI0QUNCOToxMEI4MjM2OjE2MERCM0Y6NkIwMTA5N0EiLCJ2aXNpdG9yX2lkIjoiNDk2NzM0NjA2ODY2MTUzNzE0NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4707865e22d06f357651e48a810ed4833e119002e696312b9c330dcb8985464a |
| hovercard-subject-tag | issue:4430278095 |
| 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/697/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6307fbeb0b872d6b3d869377666e90d9d46a2eb6713dbf68abef82003acc90bb/adcontextprotocol/adcp-client-python/issues/697 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6307fbeb0b872d6b3d869377666e90d9d46a2eb6713dbf68abef82003acc90bb/adcontextprotocol/adcp-client-python/issues/697 |
| og:image:alt | Follow-up to #380 / #692. Context PgBuyerAgentRegistry.with_caching(**kwargs) shipped in #692 collapses cache wiring into one call. But the canonical production stack documented in registry_cache.p... |
| 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