Bourse.LiveDrift (bourse v0.1.0)

Copy Markdown View Source

Scheduled, read-only verification of provider response contracts.

Public responses are compared with committed reality recordings only at envelope and field paths consumed by the authored runtime spec. Private profiles prove one authenticated read per supported venue.

A runner environment may declare venues it cannot reach (geo-blocked hosts) via the LIVE_DRIFT_UNREACHABLE_OK env var or the :unreachable_ok option. For those venues only, $request capture errors classified as exchange_not_available or network_error land in the report's unreachable section instead of failures — reported loudly, never graded green as evidence. Drift comparisons on a reachable response always fail hard regardless of the allowlist.

Summary

Functions

Validates exact support, read-only profiles, and all credentials.

Returns the activated scheduled profile for every supported venue.

Runs the ten public and private read checks and returns a scrubbed report.

Types

option()

@type option() ::
  {:capture, (String.t(), atom(), keyword() -> {:ok, map()} | {:error, term()})}
  | {:capture_opts, keyword()}
  | {:get_env, (String.t() -> String.t() | nil)}
  | {:manifest_venues, [String.t()]}
  | {:unreachable_ok, [String.t()]}

report()

@type report() :: %{
  failures: [map()],
  observations: [map()],
  run: map(),
  status: String.t(),
  unreachable: [map()],
  venues: [map()]
}

Functions

preflight(opts \\ [])

@spec preflight([option()]) :: :ok | {:error, term()}

Validates exact support, read-only profiles, and all credentials.

profiles()

@spec profiles() :: %{required(String.t()) => map()}

Returns the activated scheduled profile for every supported venue.

run(opts \\ [])

@spec run([option()]) :: {:ok, report()} | {:error, report() | term()}

Runs the ten public and private read checks and returns a scrubbed report.