Selecto.Domain.ContractVerification (Selecto v0.4.8)

Copy Markdown

Read-only verification for published Selecto domain query surfaces.

This module is the first consumer-aware contract verification slice. It projects provider domains into named published query surfaces, reads consumer domain_dependencies, and verifies that each consumer still depends only on fields, filters, query members, versions, and fingerprints the provider currently publishes.

Summary

Functions

Diffs two contract snapshots and classifies compatible, review-required, and breaking changes.

Projects published query surfaces from a provider domain and validates that explicit surface references resolve against the provider query contract.

Builds a stable snapshot artifact for a provider's published query surfaces.

Verifies one consumer domain against one provider domain.

Types

verification_result()

@type verification_result() :: {:ok, map()} | {:error, map()}

Functions

diff_snapshots(left, right)

@spec diff_snapshots(map(), map()) :: map()

Diffs two contract snapshots and classifies compatible, review-required, and breaking changes.

published_surfaces(provider, opts \\ [])

@spec published_surfaces(
  term(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Projects published query surfaces from a provider domain and validates that explicit surface references resolve against the provider query contract.

snapshot(provider, opts \\ [])

@spec snapshot(
  term(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Builds a stable snapshot artifact for a provider's published query surfaces.

snapshot_format()

snapshot_format_version()

verify(provider, consumer, opts \\ [])

@spec verify(term(), term(), keyword()) :: verification_result()

Verifies one consumer domain against one provider domain.