cyberneticlibrary

Detect and fix API specification drift

api-contract-drift-detectorworkflowsetup L30
hiranp/polyflow
What it does

Detect API endpoint shape drift from OpenAPI spec

Best for

Catching API shape evolution that outruns documentation, automated on every release.

Inputs
  • · OpenAPI spec file path
  • · base URL
  • · endpoint list
Outputs
  • · drift summary per endpoint
  • · corrected spec snippets
  • · draft PR (if drifted)
Requires
  • · agent() (Haiku)
  • · parallel()
  • · HTTP calls to live API
Preconditions

Workflow runtime; live API endpoint accessible; OpenAPI spec in repo; PR write access

Failure modes
  • · Spec change doesn't match actual endpoint behavior (agent lies)
  • · API returns 5xx errors (no drift verdict possible)
  • · Spec has optional fields spec claims required — ambiguous whether drift or schema flexibility
Trust signals
  • · Live endpoint call vs spec shape
  • · Haiku model (fast, cheap checks)
  • · Parallel checking (all endpoints at once)
  • · Draft PR if drift detected (reviewer gate)