Class SemanticDriftExtension

java.lang.Object
org.mockserver.mock.drift.SemanticDriftExtension

public class SemanticDriftExtension extends Object
Optional LLM-powered extension to DriftAnalyzer. When a configured LLM backend is available, classifies each structural drift record as BREAKING / WARNING / INFORMATIONAL and adds a one-sentence explanation.

Called asynchronously on the drift-analysis scheduler thread — never blocks the HTTP response path. Enrichment is best-effort: any LLM failure leaves the drift records with their original structural-only data.

  • Constructor Details

  • Method Details

    • isAvailable

      public boolean isAvailable()
      Returns:
      true if both the completion service and backend are configured.
    • enrich

      public void enrich(List<DriftRecord> records, String expectationId, HttpResponse stubResponse, HttpResponse realResponse)
      Enriches drift records with semantic severity and explanation using the LLM. Must not block the response path — called asynchronously.