PtcRunner.Kernel.MissionEnvironment (PtcRunner v0.15.0)

Copy Markdown View Source

Frozen authority for confined subordinate programs.

A mission environment contains only its optional bundle, explicitly granted capabilities, and JSON-like mission data. Subordinate evaluation is built exclusively from this struct and committed evaluation memory/history; it never inherits or falls back to the workflow environment.

Workflow-only reserved routes such as subordinate evaluation and annotation are absent. Construction validates the bundle attestation, capability names, data, recorded tool requirements, and an optional source catalog attested with the bundle so source cannot be paired with a different compiled graph. :shipped_component_ids records the shipped library selections represented by the bundle for exact diagnostic misses. :inspect_only is attested with the environment so a compile-and-inspect assembly that skipped tool requirements cannot be placed in an ordinary runnable configuration.

Summary

Functions

Assembles a mission environment from optional :bundle, :capabilities, JSON-like :data, :catalog, :shipped_component_ids, and :inspect_only options. Unknown options are rejected. :inspect_only skips recorded tool-requirement checks so a compile-and-inspect session can attach source without installing capabilities. The resulting environment attests that mode; RunConfig refuses it unless inspect_only is also true.

Types

t()

@type t() :: %PtcRunner.Kernel.MissionEnvironment{
  attestation: binary(),
  bundle: PtcRunner.Kernel.FrozenBundle.t() | nil,
  capabilities: %{required(binary()) => PtcRunner.Kernel.Capability.t()},
  catalog: PtcRunner.Kernel.ComponentCatalog.t(),
  data: map(),
  inspect_only: boolean(),
  shipped_component_ids: [binary()]
}

Functions

new(opts)

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

Assembles a mission environment from optional :bundle, :capabilities, JSON-like :data, :catalog, :shipped_component_ids, and :inspect_only options. Unknown options are rejected. :inspect_only skips recorded tool-requirement checks so a compile-and-inspect session can attach source without installing capabilities. The resulting environment attests that mode; RunConfig refuses it unless inspect_only is also true.