AgentBlueprintProtocol.Evidence (Agent Blueprint Protocol v1.1.0)

Copy Markdown View Source

This struct records checks and facts produced by verification.

Use it when inspecting results of compatibility or reconcile operations.

Signature creation time, lifecycle state, and signing-key and signature time validity are host-owned facts and always appear in not_verified.

This module does not authorize operations.

Example

match?({:ok, %AgentBlueprintProtocol.Evidence{}}, AgentBlueprintProtocol.Evidence.build())

Summary

Types

A check record. Detail variants may grow, so match known forms and keep a catch-all branch.

A fact whose truth is judged by the host rather than the protocol verifier.

t()

The public data type for AgentBlueprintProtocol.Evidence.

Functions

Creates an Evidence value from validated check results and facts.

Types

check()

(since 1.0.0)
@type check() :: %{
  surface: atom(),
  subject: [binary() | non_neg_integer()],
  verified: boolean(),
  detail: term()
}

A check record. Detail variants may grow, so match known forms and keep a catch-all branch.

host_owned()

(since 1.0.0)
@type host_owned() ::
  :tenancy
  | :live_policy
  | :authority
  | :effect_ownership
  | :execution
  | :billing
  | :evaluation_truth
  | :signature_created_at
  | :lifecycle_state
  | :signature_time_validity

A fact whose truth is judged by the host rather than the protocol verifier.

t()

(since 1.0.0)
@type t() :: %AgentBlueprintProtocol.Evidence{
  blueprint_digest: AgentBlueprintProtocol.Digest.t() | nil,
  checks: [check()],
  clamps: [AgentBlueprintProtocol.BoundsAlgebra.ClampEvidence.t()],
  deployment_digest: AgentBlueprintProtocol.Digest.t() | nil,
  effective_bounds: AgentBlueprintProtocol.BoundsAlgebra.BoundSet.t() | nil,
  not_verified: [host_owned() | atom()],
  optional_extensions_retained: [binary()],
  protocol_revision: pos_integer() | nil
}

The public data type for AgentBlueprintProtocol.Evidence.

Functions

build(attrs \\ [])

(since 1.0.0)
@spec build(keyword() | map()) ::
  {:ok, t()} | {:error, AgentBlueprintProtocol.Error.t()}

Creates an Evidence value from validated check results and facts.

Example

match?(
  {:ok, %AgentBlueprintProtocol.Evidence{}},
  AgentBlueprintProtocol.Evidence.build()
)
match?(
  {:ok, %AgentBlueprintProtocol.Evidence{}},
  AgentBlueprintProtocol.Evidence.build(not_verified: [:tenancy])
)