Skip to content

feat(decisioning): add full stack registry factory#765

Open
sangilish wants to merge 1 commit into
adcontextprotocol:mainfrom
sangilish:feat/pg-registry-full-stack-697
Open

feat(decisioning): add full stack registry factory#765
sangilish wants to merge 1 commit into
adcontextprotocol:mainfrom
sangilish:feat/pg-registry-full-stack-697

Conversation

@sangilish
Copy link
Copy Markdown

Summary

Refs #697.

This adds PgBuyerAgentRegistry.with_full_stack() as the one-call factory for the documented production wrapper order: Caching(RateLimited(Auditing(pg))).

What changed

  • Added with_full_stack() to PgBuyerAgentRegistry.
  • Builds the canonical cache -> rate-limit -> audit stack while returning the outer CachingBuyerAgentRegistry.
  • Threads audit_sink and sink_timeout_seconds through all three layers.
  • Shares time_source between cache and rate limiter for deterministic tests.
  • Wires Pg mutations through this registry instance to clear the returned cache.
  • Documents the fixed layer order and points adopters with non-default ordering needs to manual composition.

Testing

  • uv run ruff check src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.py
  • uv run mypy src/adcp/decisioning/pg/buyer_agent_registry.py
  • ADCP_PG_TEST_URL=postgresql://postgres:[email protected]:55432/postgres uv run python -m pytest tests/conformance/decisioning/test_pg_buyer_agent_registry.py -q
  • uv run python -m pytest tests/test_buyer_agent_registry_cache.py -q

@sangilish sangilish marked this pull request as ready for review May 20, 2026 23:29
@sangilish
Copy link
Copy Markdown
Author

This is ready for review now. CI is green, and I kept the change scoped to #697: the documented Caching(RateLimited(Auditing(pg))) factory with mutation invalidation and audit/rate-limit coverage.

@bokelley
Copy link
Copy Markdown
Contributor

Thanks for the heads-up — noted. The PR is queued for human review; a maintainer will pick it up from here.


Triaged by Claude Code. Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants