# `PtcRunner.Kernel.PreparedRun`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/prepared_run.ex#L1)

Sealed provider-inert output of phases 4 and 5.

It contains no filesystem path, credential, endpoint, provider callback
result, artifact destination, or arbitrary lower-level failure. Its creating
process owns the linked active-lifecycle marker until single-use consumption
atomically transfers lifecycle ownership to the consumer.

# `t`

```elixir
@type t() :: %PtcRunner.Kernel.PreparedRun{
  attestation: binary() | nil,
  catalog_attestation: binary(),
  effective_application_digest: binary(),
  effective_application_projection: map(),
  effective_data_class: :normal | :private_inspection,
  effective_event_policy: :normal | :private,
  effective_flow: :normal | :private,
  entry_source: binary(),
  installation_config_digests: %{required(binary()) =&gt; binary()},
  mission_bundles: %{
    required(binary()) =&gt; PtcRunner.Kernel.FrozenBundle.t() | nil
  },
  post_selection_context: map(),
  provider_activity: PtcRunner.Kernel.ProviderActivity.t(),
  provider_declarations: [map()],
  request: PtcRunner.Kernel.RunRequest.t(),
  workflow_bundle: PtcRunner.Kernel.FrozenBundle.t()
}
```

# `close`

```elixir
@spec close(t()) :: :ok | {:error, :not_owner | :provider_activity_unavailable}
```

Idempotently releases the prepared run's activity owner.

After `consume/1` transfers ownership, only the consuming process can release
a live owner; the former owner receives `{:error, :not_owner}`. A bounded-call
failure returns `{:error, :provider_activity_unavailable}`.

# `new`

```elixir
@spec new(
  PtcRunner.Kernel.RunRequest.t(),
  PtcRunner.Kernel.FrozenBundle.t(),
  %{required(binary()) =&gt; PtcRunner.Kernel.FrozenBundle.t() | nil},
  binary(),
  PtcRunner.Kernel.ProviderActivity.t(),
  PtcRunner.Kernel.InstallationCatalog.t(),
  map()
) :: {:ok, t()} | {:error, :invalid_prepared_run}
```

# `sealed?`

```elixir
@spec sealed?(term()) :: boolean()
```

Checks the preparation's seal without asking anything about its lifecycle.

Every other predicate here pairs the seal with one lifecycle state, which is
the right question while a command owns the run. A value that only has to be
the preparation it claims to be — a result binding itself to one, for
instance — asks this instead, because the run may be claimed, consumed, or
already closed by the time the binding is checked.

# `valid?`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
