Insider.Observability.Export (Insider v0.1.0)

Copy Markdown View Source

A bounded, vendor-neutral projection of a validated incident capsule.

An export is inert data for a host-owned asynchronous client. It contains no event bodies, payloads, artifact references, endpoints, credentials, client callbacks, or delivery claims. Constructing or decoding one never performs network work and grants no collection or transport authority.

Summary

Functions

Derives the only fields approved by the v1 observability boundary.

Re-derives an export from its complete capsule graph and requires exact equality.

Types

t()

@type t() :: %Insider.Observability.Export{
  destination_fingerprint: term(),
  evidence: term(),
  finding: term(),
  id: term(),
  idempotency_key: term(),
  incident_id: term(),
  provider: term(),
  schema: term()
}

Functions

canonical_binary(export)

@spec canonical_binary(term()) ::
  {:ok, binary()} | {:error, Insider.Protocol.Error.t()}

decode(binary)

@spec decode(binary()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}

decode_map(wire)

@spec decode_map(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}

new(capsule, provider, destination_fingerprint)

@spec new(Insider.Incident.Capsule.t(), String.t(), String.t()) ::
  {:ok, t()} | {:error, Insider.Protocol.Error.t()}

Derives the only fields approved by the v1 observability boundary.

destination_fingerprint is a host-owned opaque SHA-256 identity. It is not a URL, DSN, site, project name, credential, or proof of authorization.

to_wire_map(export)

@spec to_wire_map(t()) :: map()

validate(export)

@spec validate(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}

validate_against_capsule(export, capsule)

@spec validate_against_capsule(term(), term()) ::
  {:ok, t()} | {:error, Insider.Protocol.Error.t()}

Re-derives an export from its complete capsule graph and requires exact equality.

Standalone validation proves only bounded canonical identity, not that an export was authored from the referenced capsule. Host integrations must use this function immediately before provider mapping.