Pattern Proposal: Provider Client Adapter
Summary
Abstracts external provider SDK calls behind dedicated client classes with drop-in test doubles.
Candidate Pattern
- ID:
provider-client-adapter - Classification: architectural
- Maturity: strategic_direction
- Type: emerging
Observed Signals
No specific signals listed.
Evidence
Supporting Evidence
- src/cas_runner/llm/litellm_client.py (LiteLLMClient) - Encapsulates external LiteLLM API interactions.
- src/cas_runner/llm/mock_client.py (MockLLMClient) - Provides deterministic test double adhering to the client interface.
Scope Assessment
- Evidence Strength: high
- Confidence: high
- Applies to: ideas-to-life-cas
Rationale
- Intent: Decouple domain and application logic from third-party vendor interfaces and enable deterministic local testing without external API calls.
- Context: The system relies on external SDKs for upstream processing (e.g., LiteLLM), but internal engines and automated CI tests require offline deterministic execution.
- Force: Direct imports of external client libraries couple business services to vendor SDKs
- Force: CI pipelines require offline hermetic test runs
Traceability
Artifact source: proposed-patterns