BoundedAuthorityProtocol.Conformance.Report (Bounded Authority Protocol v0.1.2)

Copy Markdown View Source

Pure report builder for the loaded corpus and runner results.

build/2 computes overall agreement (every case agreed with its expectation), the exit status (0 on complete agreement, 1 otherwise), and the applicability matrix summary. to_bytes/2 emits deterministic JCS-canonical report bytes through the package's own V1.Jcs.encode/2 — one canonicalizer, no second encoder.

Summary

Functions

Builds the agreement report from the loaded corpus and runner results.

The canonical corpus identity: base64url of the SHA-256 of the exact index.json bytes the run loaded. Recomputed at load; bound into the report and asserted against the certified snapshot by the CLI (ADR 0014 D4 — parity with the SDK runners, which pin the same value).

Emits deterministic JCS-canonical report bytes.

Types

t()

@type t() :: %BoundedAuthorityProtocol.Conformance.Report{
  agreed: non_neg_integer(),
  agreement: boolean(),
  disagreed: non_neg_integer(),
  exit_status: 0 | 1,
  total: non_neg_integer()
}

Functions

build(corpus, results)

@spec build(BoundedAuthorityProtocol.Conformance.Corpus.t(), [
  {binary(), [%{case_id: binary(), agree: boolean()}]}
]) :: t()

Builds the agreement report from the loaded corpus and runner results.

index_identity(index_bytes)

@spec index_identity(binary()) :: binary()

The canonical corpus identity: base64url of the SHA-256 of the exact index.json bytes the run loaded. Recomputed at load; bound into the report and asserted against the certified snapshot by the CLI (ADR 0014 D4 — parity with the SDK runners, which pin the same value).

to_bytes(corpus, results)

@spec to_bytes(BoundedAuthorityProtocol.Conformance.Corpus.t(), [
  {binary(), [%{case_id: binary(), agree: boolean()}]}
]) :: {:ok, binary()} | {:error, :invalid}

Emits deterministic JCS-canonical report bytes.