Spectre.GAM.Disclosure (Spectre v0.4.0)

Copy Markdown View Source

Closed description of information crossing a Domain boundary.

The descriptor names destinations and the durable Evidence that may have influenced the output. Labels are derived from those Evidence records by the kernel; callers cannot use this value to assert weaker labels.

Summary

Functions

Returns the plain ledger representation.

Restores a descriptor from its canonical representation.

Returns true when every disclosed label is explicitly covered by a Mandate.

Builds the canonical disclosure descriptor.

Validates how the descriptor relates to one Candidate or Act.

Checks that every source exists and that its conservative label union is exact.

Types

t()

@type t() :: %Spectre.GAM.Disclosure{
  destination_refs: [String.t()],
  labels: [Spectre.GAM.Label.t()],
  schema_version: 1,
  source_evidence_refs: [String.t()]
}

Functions

canonical(disclosure)

@spec canonical(t()) :: map()

Returns the plain ledger representation.

from_canonical(value)

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

Restores a descriptor from its canonical representation.

labels_covered?(disclosure, allowed_labels)

@spec labels_covered?(t(), [Spectre.GAM.Label.t()]) :: boolean()

Returns true when every disclosed label is explicitly covered by a Mandate.

new(disclosure)

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

Builds the canonical disclosure descriptor.

validate_boundary(row, disclosure, target_refs, evidence_refs)

@spec validate_boundary(Spectre.GAM.Row.t(), t() | nil, [String.t()], [String.t()]) ::
  :ok | {:error, term()}

Validates how the descriptor relates to one Candidate or Act.

verify_sources(disclosure, evidence_index)

@spec verify_sources(t(), %{optional(String.t()) => Spectre.GAM.Evidence.t()}) ::
  :ok | {:error, term()}

Checks that every source exists and that its conservative label union is exact.