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

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.

Summary

Functions

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

Types

t()

@type t() :: %BoundedAuthorityProtocol.Conformance.Corpus{
  case_ids: term(),
  cases: [{binary(), [map()]}],
  index: map(),
  index_bytes: binary(),
  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.