PtcRunner.Kernel.CommandSource (PtcRunner v0.14.0)

Copy Markdown View Source

Closed, path-free provenance for command diagnostics.

Names are fixed document roles or portable logical application names. A filesystem path, provider alias, endpoint, or caller-selected private input name is never a command source. Internal byte bounds and optional contract authority are attested so callers cannot widen a span or substitute a path from another classifying contract by mutating the struct.

Summary

Functions

Constructs provenance with the exact trusted source-byte bound used by spans.

Types

kind()

@type kind() ::
  :host
  | :project
  | :application
  | :component
  | :input_contract
  | :result_contract
  | :external_input
  | :component_override
  | :runtime

t()

@type t() :: %PtcRunner.Kernel.CommandSource{
  attestation: binary(),
  byte_size: non_neg_integer() | nil,
  contract_authority: PtcRunner.Kernel.CommandContractAuthority.t() | nil,
  kind: kind(),
  name: binary()
}

Functions

fixed(atom)

@spec fixed(kind()) :: t()

new(kind, name)

@spec new(kind(), binary()) :: {:ok, t()} | {:error, :invalid_command_source}

to_map(source)

@spec to_map(t()) :: map()

valid?(source)

@spec valid?(term()) :: boolean()

with_bytes(kind, name, bytes)

@spec with_bytes(kind(), binary(), binary()) :: t()

Constructs provenance with the exact trusted source-byte bound used by spans.