mix lattice_stripe.api_surface (LatticeStripe v2.0.0)

Copy Markdown View Source

Checks — or regenerates — the committed public API surface lock.

priv/api/current.txt is the mechanical form of the semver contract written in guides/api_stability.md: every module under lib/ without @moduledoc false, plus its public functions (every callable arity, including those reachable through default arguments), struct field names, types, behaviour callbacks, and protocol implementations.

A line removed from the lock is a breaking change. A line added is a feature.

Usage

# Verify the compiled surface matches the committed lock (the default):
mix lattice_stripe.api_surface
mix lattice_stripe.api_surface --check

# Accept the current surface and rewrite the lock (local development only):
mix lattice_stripe.api_surface --update

Exit codes

  • 0 — the compiled public surface matches the lock
  • 100 — surface violation: the lock and the code disagree
  • 101 — the tool could not run (missing lock file, incomplete build, bad flags)

Distinct codes so CI can tell "the API changed" from "the check itself broke" — a distinction almost no comparable tool makes, and the one that decides whether a red build means review this or fix the tooling.

--update is refused when CI is set

The one safety property that survived in the ecosystem survey of these tools is that the regenerator is simply unavailable in the gating environment. Where regeneration is possible in CI, it eventually becomes the reflex, and the gate stops gating.