Spectre.Projection.HumanReport (Spectre v0.3.0)

Copy Markdown View Source

Mechanical human-review projection for one governed Definition change.

The report combines an exact structural/textual diff with an already verified evaluation delta. It never invokes a model and never labels a Candidate as semantically "better"; it exposes measured evidence and limits.

Summary

Functions

Decodes and verifies a canonical report.

Encodes a report with the production canonical codec.

Restores and verifies a report from portable data.

Returns the fixed generator id.

Projects a deterministic report from two canonical Definitions.

Returns JSON-shaped report data.

Verifies that report contents still match its digest.

Returns the fixed generator version.

Types

t()

@type t() :: %Spectre.Projection.HumanReport{
  candidate_definition_ref: String.t(),
  digest: String.t(),
  evaluation_delta: map(),
  gate_receipt_refs: [String.t()],
  generator_id: String.t(),
  generator_version: pos_integer(),
  input_evidence_digest: String.t(),
  lineage_refs: [String.t()],
  parent_definition_ref: String.t(),
  structural_changes: [map()],
  textual_changes: [map()]
}

Functions

decode(encoded)

@spec decode(binary()) :: {:ok, t()} | {:error, term()}

Decodes and verifies a canonical report.

encode(report)

@spec encode(t()) :: {:ok, binary()} | {:error, term()}

Encodes a report with the production canonical codec.

from_data(data)

@spec from_data(map()) :: {:ok, t()} | {:error, term()}

Restores and verifies a report from portable data.

id()

Returns the fixed generator id.

project(parent, candidate, opts \\ [])

@spec project(
  Spectre.Definition.Canonical.t(),
  Spectre.Definition.Canonical.t(),
  keyword()
) ::
  {:ok, t()} | {:error, term()}

Projects a deterministic report from two canonical Definitions.

to_data(report)

@spec to_data(t()) :: map()

Returns JSON-shaped report data.

verify(report)

@spec verify(t()) :: :ok | {:error, term()}

Verifies that report contents still match its digest.

version()

Returns the fixed generator version.