BoundedAuthorityProtocol.Conformance.Corpus (Bounded Authority Protocol v0.8.0)

Copy Markdown View Source

Pure loader and integrity verifier for the portable conformance corpus.

load/1 takes %{path => binary} (no I/O), decodes every .json file through BoundedAuthorityProtocol.V1.Json.decode/2 at Bounds.maximum(), and verifies every corpus-integrity property named by the conformance contract:

  • per-file SHA-256 (.json and .raw) against the index,
  • exact file-set equality both directions,
  • per-file and total case counts,
  • corpus-wide case-id uniqueness,
  • applicability totality (every surface exactly 28, every class leaf exactly 16, required cells nonempty, n_a cells empty), and
  • tamper verbatim-vs-derived byte equality and .raw hash binding.

.raw sidecars are hash-verified and carried as opaque binaries; they are never parsed.

Every failure returns the fixed value-free {:error, :invalid}. The loaded corpus carries decoded cases, sidecar bytes, and the index for the runner and report.

load_strict_ed25519/1 loads the additive strict-Ed25519 corpus (profile bap-strict-ed25519/1), whose index has its own closed shape: per-file lowercase-hex SHA-256, per-file and per-family case counts, a profile and a revision sidecar, and no applicability matrix. The loaded corpus carries major: :strict_ed25519; each case names its own surface and, for v1/v2-shaped families, its own contract-major.

Summary

Functions

Loads and integrity-verifies a %{path => binary} corpus map.

Loads and integrity-verifies the %{path => binary} strict-Ed25519 corpus map.

Types

t()

@type t() :: %BoundedAuthorityProtocol.Conformance.Corpus{
  case_ids: term(),
  cases: [{binary(), [map()]}],
  index: map(),
  index_bytes: binary(),
  major: 1 | 2 | 3 | :strict_ed25519,
  raws: %{required(binary()) => binary()}
}

Functions

load(map)

@spec load(%{required(binary()) => binary()}) :: {:ok, t()} | {:error, :invalid}

Loads and integrity-verifies a %{path => binary} corpus map.

load_strict_ed25519(map)

@spec load_strict_ed25519(%{required(binary()) => binary()}) ::
  {:ok, t()} | {:error, :invalid}

Loads and integrity-verifies the %{path => binary} strict-Ed25519 corpus map.