Skip to content

Pattern Proposal: Adapter-Based Client Substitution

Summary

Provide interchangeable client implementations using a shared interface to allow seamless switching between live external dependencies and local mocks.

Candidate Pattern

  • ID: adapter-based-client-substitution
  • Classification: architectural
  • Maturity: strategic_direction
  • Type: emerging

Observed Signals

No specific signals listed.

Evidence

Supporting Evidence

Scope Assessment

  • Evidence Strength: high
  • Confidence: high
  • Applies to: ideas-to-life-cas

Rationale

  • Intent: Decouple external provider communications from internal execution flow and enable deterministic offline unit testing.
  • Context: The system depends on external LLM inference providers via litellm, but must also be able to run offline, during automated CI, or in unit tests.
  • Force: External API calls are non-deterministic, network-dependent, and introduce cost
  • Force: Testing pipeline execution without external credentials requires deterministic mocking

Traceability

Artifact source: proposed-patterns